From: David Wells Date: Sat, 25 Feb 2017 16:18:28 +0000 (-0500) Subject: Check that numdiff and diff can run with very simple input. X-Git-Tag: v8.5.0-rc1~84^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=54acb5ae43836db767169e937e57d9755373aa73;p=dealii.git Check that numdiff and diff can run with very simple input. This commit adds a check to ensure that calling diff or numdiff does not hang forever: if it does hang (or cannot be run at all) then we cannot run the test suite, so bail out. --- diff --git a/cmake/macros/macro_deal_ii_pickup_tests.cmake b/cmake/macros/macro_deal_ii_pickup_tests.cmake index 07031858d8..460ed70ca2 100644 --- a/cmake/macros/macro_deal_ii_pickup_tests.cmake +++ b/cmake/macros/macro_deal_ii_pickup_tests.cmake @@ -113,6 +113,26 @@ MACRO(DEAL_II_PICKUP_TESTS) SET(NUMDIFF_EXECUTABLE ${DIFF_EXECUTABLE}) ENDIF() + # + # Check that the diff programs can run and terminate successfully: + # + FOREACH(_diff_program ${NUMDIFF_EXECUTABLE} ${DIFF_EXECUTABLE}) + EXECUTE_PROCESS(COMMAND ${_diff_program} "-v" + TIMEOUT 4 # seconds + OUTPUT_QUIET + ERROR_QUIET + RESULT_VARIABLE _diff_program_status + ) + + IF(NOT "${_diff_program_status}" STREQUAL "0") + MESSAGE(FATAL_ERROR + "\nThe command \"${_diff_program} -v\" did not run correctly: it either " + "failed to exit after a few seconds or returned a nonzero exit code. " + "The test suite cannot be set up without this program, so please " + "reinstall it and then run the test suite setup command again.\n") + ENDIF() + ENDFOREACH() + # # Set time limit: #