-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
1,004 additions
and
1,351 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[submodule "external/Catch2"] | ||
path = external/Catch2 | ||
url = https://github.com/catchorg/Catch2.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,15 @@ | ||
find_package(Boost) | ||
add_executable(test_all test_all.cc test_engines.cc test_distributions.cc test_special_functions.cc test_int_math.cc test_linear_algebra.cc) | ||
target_link_libraries(test_all PRIVATE trng4::trng4 Catch2::Catch2) | ||
if (WIN32 AND BUILD_SHARED_LIBS) | ||
add_custom_command(TARGET test_all POST_BUILD | ||
COMMAND ${CMAKE_COMMAND} -E copy | ||
$<TARGET_RUNTIME_DLLS:test_all> | ||
$<TARGET_FILE_DIR:test_all> | ||
COMMAND_EXPAND_LISTS) | ||
endif () | ||
|
||
if (Boost_FOUND) | ||
set(Boost_USE_STATIC_LIBS OFF) | ||
find_package(Boost REQUIRED COMPONENTS unit_test_framework) | ||
set(CMAKE_MODULE_PATH ../external/Catch2/contrib ${CMAKE_MODULE_PATH}) | ||
include(CTest) | ||
include(Catch) | ||
|
||
add_executable(test_all test_all.cc test_engines.cc test_distributions.cc test_math.cc test_int_math.cc type_names.cc test_linear_algebra.cc) | ||
target_link_libraries(test_all PUBLIC trng4::trng4 Boost::unit_test_framework) | ||
if (WIN32 AND BUILD_SHARED_LIBS) | ||
add_custom_command(TARGET test_all POST_BUILD | ||
COMMAND ${CMAKE_COMMAND} -E copy | ||
$<TARGET_RUNTIME_DLLS:test_all> | ||
$<TARGET_FILE_DIR:test_all> | ||
COMMAND_EXPAND_LISTS) | ||
endif () | ||
if (CMAKE_CXX_COMPILER_ID MATCHES MSVC) | ||
target_compile_options(test_all PUBLIC "/bigobj") | ||
endif () | ||
add_test(NAME run_test_all COMMAND test_all --log_level=test_suite CONFIGURATIONS Debug Release RelWithDebInfo) | ||
if (WIN32) | ||
set(exec_path_debug "PATH=${Boost_LIBRARY_DIR_DEBUG}$<SEMICOLON>$ENV{PATH}") | ||
set(exec_path_release "PATH=${Boost_LIBRARY_DIR_RELEASE}$<SEMICOLON>$ENV{PATH}") | ||
string(TOLOWER ${CMAKE_BUILD_TYPE} build_type) | ||
if (build_type STREQUAL debug) | ||
set_tests_properties(run_test_all PROPERTIES ENVIRONMENT "${exec_path_debug}") | ||
elseif (build_type STREQUAL release) | ||
set_tests_properties(run_test_all PROPERTIES ENVIRONMENT "${exec_path_release}") | ||
elseif (build_type STREQUAL relwithdebinfo) | ||
set_tests_properties(run_test_all PROPERTIES ENVIRONMENT "${exec_path_release}") | ||
endif () | ||
endif () | ||
endif () | ||
catch_discover_tests(test_all) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.