From 0503052790b29deb40813b359d5a2a84628fa271 Mon Sep 17 00:00:00 2001 From: Matthias Maier Date: Tue, 4 Jul 2023 09:06:12 -0500 Subject: [PATCH] Quick tests: also populate the test target when configuring tests directly --- tests/CMakeLists.txt | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 55069f3d22..f3fe17a96c 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -164,25 +164,25 @@ foreach(_category ${_categories}) ) endforeach() +# +# Define a top-level "test" target that runs our quick tests wrapper. +# -if(DEFINED DEAL_II_HAVE_TESTS_DIRECTORY) +# Use the first available build type (this prefers debug mode if available): +list(GET DEAL_II_BUILD_TYPES 0 _my_build) +add_custom_target(test + COMMAND ${CMAKE_COMMAND} -DCMAKE_BUILD_TYPE=${_my_build} -P ${CMAKE_CURRENT_SOURCE_DIR}/run_quick_tests.cmake + WORKING_DIRECTORY ${CMAKE_BINARY_DIR} + COMMENT "Running quicktests..." + ) +add_dependencies(test setup_tests_quick_tests) +if(DEFINED DEAL_II_HAVE_TESTS_DIRECTORY) # - # Define a top-level "test" target that runs our quick tests wrapper. - # - - # Use the first available build type (this prefers debug mode if available): - list(GET DEAL_II_BUILD_TYPES 0 _my_build) - add_custom_target(test - COMMAND ${CMAKE_COMMAND} -DCMAKE_BUILD_TYPE=${_my_build} -P ${CMAKE_CURRENT_SOURCE_DIR}/run_quick_tests.cmake - WORKING_DIRECTORY ${CMAKE_BINARY_DIR} - COMMENT "Running quicktests..." - ) - # Depend on the library targets (to ensure that deal.II is actually # compiled), as well as on the setup_tests_quick_tests target to ensure # that quick tests are actually available. - add_dependencies(test setup_tests_quick_tests) + # foreach(_build ${DEAL_II_BUILD_TYPES}) string(TOLOWER ${_build} _build_lowercase) add_dependencies(test ${DEAL_II_TARGET_NAME}_${_build_lowercase}) @@ -191,7 +191,6 @@ if(DEFINED DEAL_II_HAVE_TESTS_DIRECTORY) # # Add a dummy target to make files known to IDEs like qtcreator # - file(GLOB _misc ${CMAKE_CURRENT_SOURCE_DIR}/*.cc ${CMAKE_CURRENT_SOURCE_DIR}/*.h -- 2.39.5