From aaca3788fdac116a547375b76ea8a4fdea0cce17 Mon Sep 17 00:00:00 2001 From: Matthias Maier Date: Sun, 11 Dec 2022 12:29:38 -0600 Subject: [PATCH] CMake: bugfix: do not pass an argument as environemt variable This fixes the runscript invocation on windows configurations --- cmake/macros/macro_deal_ii_add_test.cmake | 5 ++--- cmake/scripts/run_test.sh | 7 +++++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/cmake/macros/macro_deal_ii_add_test.cmake b/cmake/macros/macro_deal_ii_add_test.cmake index 835e6a1bc9..73c3cd6af4 100644 --- a/cmake/macros/macro_deal_ii_add_test.cmake +++ b/cmake/macros/macro_deal_ii_add_test.cmake @@ -467,9 +467,8 @@ function(deal_ii_add_test _category _test_name _comparison_file) # add_custom_command(OUTPUT ${_test_directory}/output - COMMAND TEST_N_THREADS=${_n_threads} - ${BASH} ${DEAL_II_PATH}/${DEAL_II_SHARE_RELDIR}/scripts/run_test.sh - run "${_test_full}" ${_run_args} + COMMAND ${BASH} ${DEAL_II_PATH}/${DEAL_II_SHARE_RELDIR}/scripts/run_test.sh + run "${_test_full}" TEST_N_THREADS=${_n_threads} ${_run_args} COMMAND ${PERL_EXECUTABLE} -pi ${DEAL_II_PATH}/${DEAL_II_SHARE_RELDIR}/scripts/normalize.pl ${_test_directory}/output diff --git a/cmake/scripts/run_test.sh b/cmake/scripts/run_test.sh index c347497997..b3c58b6f49 100644 --- a/cmake/scripts/run_test.sh +++ b/cmake/scripts/run_test.sh @@ -53,6 +53,13 @@ case $STAGE in # testsuite to explicitly set the number of threads in the header # file tests.h. # + + # Read in TEST_N_THREADS from command line: + if [[ $1 == TEST_N_THREADS=* ]]; then + TEST_N_THREADS="${1#TEST_N_THREADS=}" + shift + fi + if [ "${TEST_N_THREADS:-0}" -ne 0 ]; then export DEAL_II_NUM_THREADS="${TEST_N_THREADS}" export TEST_N_THREADS -- 2.39.5