Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

boosttest: boost test begins #349

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion test/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,5 @@ add_subdirectory("gunit")
add_subdirectory("gtest")
add_subdirectory("doctest")
add_subdirectory("gbenchmark")
add_subdirectory("misc")
add_subdirectory("misc")
add_subdirectory("boosttest")
34 changes: 34 additions & 0 deletions test/cpp/boosttest/BoostTest.cmake
Original file line number Diff line number Diff line change
@@ -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()

3 changes: 3 additions & 0 deletions test/cpp/boosttest/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
include("BoostTest.cmake")

add_boosttest(boosttest1 "boosttest1.cpp")
7 changes: 7 additions & 0 deletions test/cpp/boosttest/boosttest1.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#define BOOST_TEST_MODULE boosttest1 test
#include <boost/test/included/unit_test.hpp>

BOOST_AUTO_TEST_CASE( constructors_test )
{
BOOST_CHECK_EQUAL( 1, 0 );
}