diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index a402a113aa7e9ece9d99b5e581a6793c22ab8c0e..a0887055182a2332976d86eb31f53d5e4b72210f 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -24,17 +24,9 @@ set(test_cases test_utils ) -# download gtest library -#include(FetchGTest) # add special cmake functions for gtest 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 list(LENGTH test_cases len_test_cases) math(EXPR len_test_cases "${len_test_cases} - 1") @@ -48,8 +40,6 @@ foreach (i RANGE "${len_test_cases}") LABELS "caosdb-cpplib-unit-tests") endforeach () - - # code coverage report include(CodeCoverage) diff --git a/test/test_utils.cpp b/test/test_utils.cpp index 619627cc53827dfbd444da9ddfc06b645cff84d5..245b0af4a03da5afc853a02993e1bb4acbbb0c55 100644 --- a/test/test_utils.cpp +++ b/test/test_utils.cpp @@ -25,6 +25,7 @@ #include <gtest/gtest-message.h> #include <gtest/gtest-test-part.h> #include "gtest/gtest_pred_impl.h" +#include <boost/beast/core/detail/base64.hpp> TEST(test_utils, base64_encode) { auto test_plain = std::string("Test"); diff --git a/test_package/CMakeLists.txt b/test_package/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..c575fe04f4d60b7ba01b60b0e3865538f4a1b677 --- /dev/null +++ b/test_package/CMakeLists.txt @@ -0,0 +1,14 @@ +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) diff --git a/test_package/conanfile.py b/test_package/conanfile.py new file mode 100644 index 0000000000000000000000000000000000000000..fb6117e7b469a0648c1418b13b7b63e7cdc179f5 --- /dev/null +++ b/test_package/conanfile.py @@ -0,0 +1,25 @@ +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) diff --git a/test_package/example.cpp b/test_package/example.cpp new file mode 100644 index 0000000000000000000000000000000000000000..99216484d65cccaae3946a2ce3c9f99e9a7dadda --- /dev/null +++ b/test_package/example.cpp @@ -0,0 +1,8 @@ +#include <iostream> +#include "caosdb/connection.h" + +int main() { + caosdb::connection::InsecureCaosDBConnectionConfig config("localhost", 8443); + + std::cout << config << "\n"; +}