From: Matthias Maier Date: Mon, 30 Mar 2015 09:03:35 +0000 (+0200) Subject: Testsuite: Allow to use stdout as comparison for test outputs X-Git-Tag: v8.3.0-rc1~343^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F705%2Fhead;p=dealii.git Testsuite: Allow to use stdout as comparison for test outputs This commit introduces an alternative to the current test setup: If a test does not create a file "output" for further test comparison its output to stdout is used to populate and output file instead. For compatibility, if a test creates the "output" file the stdout stream is discarded. --- diff --git a/cmake/macros/macro_deal_ii_add_test.cmake b/cmake/macros/macro_deal_ii_add_test.cmake index f029325c41..29c7ddbf5d 100644 --- a/cmake/macros/macro_deal_ii_add_test.cmake +++ b/cmake/macros/macro_deal_ii_add_test.cmake @@ -204,16 +204,20 @@ MACRO(DEAL_II_ADD_TEST _category _test_name _comparison_file) COMMAND rm -f ${_test_directory}/failing_output COMMAND - touch ${_test_directory}/output + rm -f ${_test_directory}/output COMMAND - ${_run_command} - || (mv ${_test_directory}/output - ${_test_directory}/failing_output + ${_run_command} > ${_test_directory}/stdout + || ((test -f ${_test_directory}/output || + cp ${_test_directory}/stdout ${_test_directory}/output) + && mv ${_test_directory}/output ${_test_directory}/failing_output && echo "${_test_full}: BUILD successful." && echo "${_test_full}: RUN failed. ------ Result: ${_test_directory}/failing_output" && echo "${_test_full}: RUN failed. ------ Partial output:" && cat ${_test_directory}/failing_output && exit 1) + COMMAND + test -f ${_test_directory}/output || + cp ${_test_directory}/stdout ${_test_directory}/output COMMAND ${PERL_EXECUTABLE} -pi ${DEAL_II_PATH}/${DEAL_II_SHARE_RELDIR}/scripts/normalize.pl ${_test_directory}/output