From: Matthias Maier Date: Sun, 11 Dec 2022 18:29:38 +0000 (-0600) Subject: CMake: bugfix: do not pass an argument as environemt variable X-Git-Tag: v9.5.0-rc1~734^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=aaca3788fdac116a547375b76ea8a4fdea0cce17;p=dealii.git CMake: bugfix: do not pass an argument as environemt variable This fixes the runscript invocation on windows configurations --- 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