From 363a07550557b64571e27f0ccdf9531ad969d7c5 Mon Sep 17 00:00:00 2001 From: Matthias Maier Date: Sun, 11 Dec 2022 00:55:03 -0600 Subject: [PATCH] Tests: Use find_package(UnixCommands) to detect a suitable shell --- cmake/macros/macro_deal_ii_add_test.cmake | 7 +++++-- cmake/macros/macro_deal_ii_pickup_tests.cmake | 5 +++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/cmake/macros/macro_deal_ii_add_test.cmake b/cmake/macros/macro_deal_ii_add_test.cmake index 113e550ca3..835e6a1bc9 100644 --- a/cmake/macros/macro_deal_ii_add_test.cmake +++ b/cmake/macros/macro_deal_ii_add_test.cmake @@ -65,6 +65,9 @@ # # The following variables must be set: # +# BASH +# - Complete path to the bash shell. +# # NUMDIFF_EXECUTABLE # - Complete path to the numdiff binary. # @@ -465,7 +468,7 @@ function(deal_ii_add_test _category _test_name _comparison_file) add_custom_command(OUTPUT ${_test_directory}/output COMMAND TEST_N_THREADS=${_n_threads} - sh ${DEAL_II_PATH}/${DEAL_II_SHARE_RELDIR}/scripts/run_test.sh + ${BASH} ${DEAL_II_PATH}/${DEAL_II_SHARE_RELDIR}/scripts/run_test.sh run "${_test_full}" ${_run_args} COMMAND ${PERL_EXECUTABLE} -pi ${DEAL_II_PATH}/${DEAL_II_SHARE_RELDIR}/scripts/normalize.pl @@ -492,7 +495,7 @@ function(deal_ii_add_test _category _test_name _comparison_file) file(GLOB _comparison_files ${_comparison_file} ${_comparison_file}.*) add_custom_command(OUTPUT ${_test_directory}/diff - COMMAND sh ${DEAL_II_PATH}/${DEAL_II_SHARE_RELDIR}/scripts/run_test.sh + COMMAND ${BASH} ${DEAL_II_PATH}/${DEAL_II_SHARE_RELDIR}/scripts/run_test.sh diff "${_test_full}" "${NUMDIFF_EXECUTABLE}" "${_comparison_file}" ${_run_args} WORKING_DIRECTORY diff --git a/cmake/macros/macro_deal_ii_pickup_tests.cmake b/cmake/macros/macro_deal_ii_pickup_tests.cmake index 85b43937ef..e81c90080a 100644 --- a/cmake/macros/macro_deal_ii_pickup_tests.cmake +++ b/cmake/macros/macro_deal_ii_pickup_tests.cmake @@ -85,6 +85,11 @@ endmacro() macro(deal_ii_pickup_tests) + # + # Find bash and perl interpreter: + # + + find_package(UnixCommands REQUIRED) find_package(Perl REQUIRED) # -- 2.39.5