From 05022e3ed65dbe8a7de999de966be3cab757db08 Mon Sep 17 00:00:00 2001 From: Matthias Maier Date: Mon, 30 Mar 2015 11:03:35 +0200 Subject: [PATCH] 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. --- cmake/macros/macro_deal_ii_add_test.cmake | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) 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 -- 2.39.5