diff --git a/test/cpp/CMakeLists.txt b/test/cpp/CMakeLists.txt index d2c76cc1..4d56975f 100644 --- a/test/cpp/CMakeLists.txt +++ b/test/cpp/CMakeLists.txt @@ -34,4 +34,5 @@ add_subdirectory("gunit") add_subdirectory("gtest") add_subdirectory("doctest") add_subdirectory("gbenchmark") -add_subdirectory("misc") \ No newline at end of file +add_subdirectory("misc") +add_subdirectory("boosttest") \ No newline at end of file diff --git a/test/cpp/boosttest/BoostTest.cmake b/test/cpp/boosttest/BoostTest.cmake new file mode 100644 index 00000000..11584e2c --- /dev/null +++ b/test/cpp/boosttest/BoostTest.cmake @@ -0,0 +1,34 @@ +include(FetchContent) + +FetchContent_Declare(boosttest + GIT_REPOSITORY https://github.com/boostorg/test.git + GIT_TAG boost-1.79.0) + +FetchContent_GetProperties(boosttest) +if(NOT boosttest_POPULATED) + FetchContent_Populate(boosttest) + add_subdirectory(${boosttest_SOURCE_DIR} ${boosttest_BINARY_DIR} + EXCLUDE_FROM_ALL) +endif() + + +# + +add_library(ThirdParty.BoostTest INTERFACE) + +target_link_libraries(ThirdParty.BoostTest + INTERFACE boost_test) + +target_compile_features(ThirdParty.BoostTest INTERFACE cxx_std_11) + +target_include_directories( + ThirdParty.BoostTest + INTERFACE "${boosttest_SOURCE_DIR}/include") + +# + +function(add_boosttest target cpp_file) + add_executable(${target} "${cpp_file}") + target_link_libraries(${target} PUBLIC ThirdParty.BoostTest) +endfunction() + diff --git a/test/cpp/boosttest/CMakeLists.txt b/test/cpp/boosttest/CMakeLists.txt new file mode 100644 index 00000000..ae8b2603 --- /dev/null +++ b/test/cpp/boosttest/CMakeLists.txt @@ -0,0 +1,3 @@ +include("BoostTest.cmake") + +add_boosttest(boosttest1 "boosttest1.cpp") \ No newline at end of file diff --git a/test/cpp/boosttest/boosttest1.cpp b/test/cpp/boosttest/boosttest1.cpp new file mode 100644 index 00000000..f6ba304e --- /dev/null +++ b/test/cpp/boosttest/boosttest1.cpp @@ -0,0 +1,7 @@ +#define BOOST_TEST_MODULE boosttest1 test +#include + +BOOST_AUTO_TEST_CASE( constructors_test ) +{ + BOOST_CHECK_EQUAL( 1, 0 ); +} \ No newline at end of file