From: Matthias Maier Date: Tue, 24 Jan 2023 16:56:35 +0000 (-0600) Subject: CMake: add_test() remove code duplication X-Git-Tag: v9.5.0-rc1~603^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6d7949d4b1d45fe2e25f78669c59ba0f0772bbc4;p=dealii.git CMake: add_test() remove code duplication --- diff --git a/cmake/macros/macro_deal_ii_add_test.cmake b/cmake/macros/macro_deal_ii_add_test.cmake index 87cdd40288..1e88c20434 100644 --- a/cmake/macros/macro_deal_ii_add_test.cmake +++ b/cmake/macros/macro_deal_ii_add_test.cmake @@ -574,37 +574,24 @@ function(deal_ii_add_test _category _test_name _comparison_file) # And finally define the test: # + add_test(NAME ${_test_full} + COMMAND ${CMAKE_COMMAND} + -DTRGT=${_test_target} + -DTEST=${_test_full} + -DEXPECT=${_expect} + -DBINARY_DIR=${CMAKE_BINARY_DIR} + -P ${DEAL_II_PATH}/${DEAL_II_SHARE_RELDIR}/scripts/run_test.cmake + WORKING_DIRECTORY ${_test_directory} + ) + set_tests_properties(${_test_full} PROPERTIES + LABEL "${_category}" + TIMEOUT ${TEST_TIME_LIMIT} + ) + if(_shared_target) - add_test(NAME ${_test_full} - COMMAND ${CMAKE_COMMAND} - -DTRGT=${_test_target} - -DTEST=${_test_full} - -DEXPECT=${_expect} - -DBINARY_DIR=${CMAKE_BINARY_DIR} - -P ${DEAL_II_PATH}/${DEAL_II_SHARE_RELDIR}/scripts/run_test.cmake - WORKING_DIRECTORY ${_test_directory} - ) set_tests_properties(${_test_full} PROPERTIES - LABEL "${_category}" - TIMEOUT ${TEST_TIME_LIMIT} FIXTURES_REQUIRED ${_test_executable_full} ) - - else() - - add_test(NAME ${_test_full} - COMMAND ${CMAKE_COMMAND} - -DTRGT=${_test_target} - -DTEST=${_test_full} - -DEXPECT=${_expect} - -DBINARY_DIR=${CMAKE_BINARY_DIR} - -P ${DEAL_II_PATH}/${DEAL_II_SHARE_RELDIR}/scripts/run_test.cmake - WORKING_DIRECTORY ${_test_directory} - ) - set_tests_properties(${_test_full} PROPERTIES - LABEL "${_category}" - TIMEOUT ${TEST_TIME_LIMIT} - ) endif() if(_exclusive)