From 508a2f34700aaa0cb0628358310cc50cd8b33518 Mon Sep 17 00:00:00 2001 From: Matthias Maier Date: Sun, 20 Feb 2022 11:00:23 -0600 Subject: [PATCH] CMake: add a .exclusive. toggle to ensure that certain tests run in serial --- cmake/macros/macro_deal_ii_add_test.cmake | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/cmake/macros/macro_deal_ii_add_test.cmake b/cmake/macros/macro_deal_ii_add_test.cmake index 99131a6c51..b9a830eef5 100644 --- a/cmake/macros/macro_deal_ii_add_test.cmake +++ b/cmake/macros/macro_deal_ii_add_test.cmake @@ -208,6 +208,14 @@ FUNCTION(DEAL_II_ADD_TEST _category _test_name _comparison_file) SET(_run_only TRUE) ENDIF() + # + # Determine whether the .exclusive. keyword is present: + # + SET(_exclusive FALSE) + IF(_file MATCHES "\\.exclusive\\.") + SET(_exclusive TRUE) + ENDIF() + # # Determine for which build types a test should be defined. # @@ -495,9 +503,14 @@ FUNCTION(DEAL_II_ADD_TEST _category _test_name _comparison_file) TIMEOUT ${TEST_TIME_LIMIT} ) - IF(NOT ENABLE_PERFORMANCE_TESTS) + IF(_exclusive) + # + # Ensure that the test is not executed concurrently with any other + # tests. + # + SET_TESTS_PROPERTIES(${_test_full} PROPERTIES RUN_SERIAL TRUE) - IF(NOT ENABLE_PERFORMANCE_TESTS) + ELSEIF(NOT ENABLE_PERFORMANCE_TESTS) # # Limit concurrency of mpi tests. We can only set concurrency for # the entire test, which includes the compiling and linking stages -- 2.39.5