From 54acb5ae43836db767169e937e57d9755373aa73 Mon Sep 17 00:00:00 2001 From: David Wells Date: Sat, 25 Feb 2017 11:18:28 -0500 Subject: [PATCH] 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. --- cmake/macros/macro_deal_ii_pickup_tests.cmake | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) 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: # -- 2.39.5