Skip to content
Snippets Groups Projects
Verified Commit 173f118b authored by Timm Fitschen's avatar Timm Fitschen
Browse files

WIP: conan

parent 39c21876
No related branches found
No related tags found
No related merge requests found
Pipeline #9687 passed
Pipeline: caosdb-cppinttest

#9688

    ...@@ -24,17 +24,9 @@ set(test_cases ...@@ -24,17 +24,9 @@ set(test_cases
    test_utils test_utils
    ) )
    # download gtest library
    #include(FetchGTest)
    # add special cmake functions for gtest # add special cmake functions for gtest
    include(GoogleTest) include(GoogleTest)
    # disable linting for gtest targets (not our concern)
    #set_target_properties(gmock_main gmock gtest gtest_main PROPERTIES
    #CXX_CLANG_TIDY ""
    #CXX_INCLUDE_WHAT_YOU_USE ""
    #EXCLUDE_FROM_ALL 1)
    # loop over all test cases and add them to the test runner # loop over all test cases and add them to the test runner
    list(LENGTH test_cases len_test_cases) list(LENGTH test_cases len_test_cases)
    math(EXPR len_test_cases "${len_test_cases} - 1") math(EXPR len_test_cases "${len_test_cases} - 1")
    ...@@ -48,8 +40,6 @@ foreach (i RANGE "${len_test_cases}") ...@@ -48,8 +40,6 @@ foreach (i RANGE "${len_test_cases}")
    LABELS "caosdb-cpplib-unit-tests") LABELS "caosdb-cpplib-unit-tests")
    endforeach () endforeach ()
    # code coverage report # code coverage report
    include(CodeCoverage) include(CodeCoverage)
    ......
    ...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
    #include <gtest/gtest-message.h> #include <gtest/gtest-message.h>
    #include <gtest/gtest-test-part.h> #include <gtest/gtest-test-part.h>
    #include "gtest/gtest_pred_impl.h" #include "gtest/gtest_pred_impl.h"
    #include <boost/beast/core/detail/base64.hpp>
    TEST(test_utils, base64_encode) { TEST(test_utils, base64_encode) {
    auto test_plain = std::string("Test"); auto test_plain = std::string("Test");
    ......
    cmake_minimum_required(VERSION 3.1)
    project(PackageTest CXX)
    include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
    conan_basic_setup()
    add_executable(example example.cpp)
    target_link_libraries(example ${CONAN_LIBS})
    # CTest is a testing tool that can be used to test your project.
    # enable_testing()
    # add_test(NAME example
    # WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/bin
    # COMMAND example)
    import os
    from conans import ConanFile, CMake, tools
    class LibcaosdbTestConan(ConanFile):
    settings = "os", "compiler", "build_type", "arch"
    generators = "cmake"
    def build(self):
    cmake = CMake(self)
    # Current dir is "test_package/build/<build_id>" and CMakeLists.txt is
    # in "test_package"
    cmake.configure()
    cmake.build()
    def imports(self):
    self.copy("*.dll", dst="bin", src="bin")
    self.copy("*.dylib*", dst="bin", src="lib")
    self.copy('*.so*', dst='bin', src='lib')
    def test(self):
    if not tools.cross_building(self):
    os.chdir("bin")
    self.run(".%sexample" % os.sep)
    #include <iostream>
    #include "caosdb/connection.h"
    int main() {
    caosdb::connection::InsecureCaosDBConnectionConfig config("localhost", 8443);
    std::cout << config << "\n";
    }
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Finish editing this message first!
    Please register or to comment