Skip to content
Snippets Groups Projects
Commit 64f203bc authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

Unit tests now under CTest control

Compilation no longer enforces unit test runs
parent 965968ee
No related branches found
No related tags found
No related merge requests found
BornAgain-1.17.99, work in progress BornAgain-1.17.99, work in progress
> Internal refactoring:
1) Unit tests now under CTest control, no longer enforced during compilation
BornAgain-1.17.0, released 2020.06.16 BornAgain-1.17.0, released 2020.06.16
> API changes: > API changes:
1) Add Nevot-Croce roughness model. 1) Add Nevot-Croce roughness model.
......
############################################################################ include(GoogleTest)
# Core unit tests
############################################################################
set(test UnitTestCore) set(test UnitTestCore)
include_directories(${CMAKE_SOURCE_DIR}/Tests/UnitTests/utilities) include_directories(${CMAKE_SOURCE_DIR}/Tests/UnitTests/utilities)
...@@ -11,5 +10,4 @@ file(GLOB include_files "*/*.h") ...@@ -11,5 +10,4 @@ file(GLOB include_files "*/*.h")
add_executable(${test} ${source_files} ${include_files}) add_executable(${test} ${source_files} ${include_files})
target_link_libraries(${test} ${BornAgainCore_LIBRARY} gtest) target_link_libraries(${test} ${BornAgainCore_LIBRARY} gtest)
# add execution of TestCore just after compilation gtest_discover_tests(${test} TEST_PREFIX Core:Unit:)
add_custom_target(${test}_run ALL DEPENDS ${test} COMMAND ${test})
############################################################################ include(GoogleTest)
# Fit unit tests
############################################################################
set(test UnitTestFit) set(test UnitTestFit)
...@@ -12,5 +10,4 @@ file(GLOB include_files "*.h") ...@@ -12,5 +10,4 @@ file(GLOB include_files "*.h")
add_executable(${test} ${source_files} ${include_files}) add_executable(${test} ${source_files} ${include_files})
target_link_libraries(${test} ${BornAgainFit_LIBRARY} gtest) target_link_libraries(${test} ${BornAgainFit_LIBRARY} gtest)
# add execution of TestCore just after compilation gtest_discover_tests(${test} TEST_PREFIX Fit:Unit:)
add_custom_target(${test}_run ALL DEPENDS ${test} COMMAND ${test})
############################################################################ include(GoogleTest)
# GUI unit tests
############################################################################
set(test UnitTestGUI) set(test UnitTestGUI)
...@@ -17,5 +15,4 @@ add_executable(${test} ${source_files} ${include_files}) ...@@ -17,5 +15,4 @@ add_executable(${test} ${source_files} ${include_files})
target_link_libraries(${test} ${BornAgainGUI_LIBRARY} gtest) target_link_libraries(${test} ${BornAgainGUI_LIBRARY} gtest)
target_link_libraries(${test} Qt5::Core Qt5::Test) target_link_libraries(${test} Qt5::Core Qt5::Test)
# add execution of TestCore just after compilation gtest_discover_tests(${test} TEST_PREFIX GUI:Unit:)
add_custom_target(${test}_run ALL DEPENDS ${test} COMMAND ${test})
############################################################################ include(GoogleTest)
# Core unit tests
############################################################################
set(test UnitTestNumeric) set(test UnitTestNumeric)
if(MSVC) if(MSVC)
...@@ -18,6 +17,4 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") ...@@ -18,6 +17,4 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
target_compile_options(${test} PUBLIC "-Wno-deprecated-copy") target_compile_options(${test} PUBLIC "-Wno-deprecated-copy")
endif() endif()
# Registering in ctest section gtest_discover_tests(${test} TEST_PREFIX Numeric:)
add_test(${test} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${test})
set_tests_properties(${test} PROPERTIES LABELS "Fullcheck")
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