]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Check that numdiff and diff can run with very simple input.
authorDavid Wells <wellsd2@rpi.edu>
Sat, 25 Feb 2017 16:18:28 +0000 (11:18 -0500)
committerDavid Wells <wellsd2@rpi.edu>
Sat, 25 Feb 2017 16:18:28 +0000 (11:18 -0500)
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

index 07031858d8be07404ccd23fe020b5d664bda482c..460ed70ca2e54d463fa6b04017feb56382aa7b14 100644 (file)
@@ -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:
   #

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.