]> https://gitweb.dealii.org/ - dealii.git/commitdiff
handle empty test output 2133/head
authorTimo Heister <timo.heister@gmail.com>
Thu, 4 Feb 2016 23:17:49 +0000 (18:17 -0500)
committerTimo Heister <timo.heister@gmail.com>
Thu, 4 Feb 2016 23:17:49 +0000 (18:17 -0500)
If the make command to compile a test returns empty output (don't ask me
why that happened on my machine), quote it in the regex to avoid an
error like:
"string sub-command REGEX, mode MATCH needs at least 5 arguments"

cmake/scripts/run_test.cmake

index a95795e7e14c3477642319de301245066229872a..78f813901d1b8e138f7b076977ecbc69da3dee2f 100644 (file)
@@ -64,11 +64,11 @@ EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND}
 # (Possible values are CONFIGURE, BUILD, RUN, DIFF, PASSED)
 #
 
-STRING(REGEX MATCH "${TEST}: CONFIGURE failed\\." _configure_regex ${_output})
-STRING(REGEX MATCH "${TEST}: BUILD failed\\." _build_regex ${_output})
-STRING(REGEX MATCH "${TEST}: RUN failed\\." _run_regex ${_output})
-STRING(REGEX MATCH "${TEST}: DIFF failed\\." _diff_regex ${_output})
-STRING(REGEX MATCH "${TEST}: PASSED\\." _passed_regex ${_output})
+STRING(REGEX MATCH "${TEST}: CONFIGURE failed\\." _configure_regex "${_output}")
+STRING(REGEX MATCH "${TEST}: BUILD failed\\." _build_regex "${_output}")
+STRING(REGEX MATCH "${TEST}: RUN failed\\." _run_regex "${_output}")
+STRING(REGEX MATCH "${TEST}: DIFF failed\\." _diff_regex "${_output}")
+STRING(REGEX MATCH "${TEST}: PASSED\\." _passed_regex "${_output}")
 
 IF(NOT "${_passed_regex}" STREQUAL "")
   SET(_stage PASSED)
@@ -115,7 +115,7 @@ ELSE()
     # Some special output in case the BUILD stage failed in a regression test:
     MESSAGE("${TEST}: BUILD failed. Output:")
   ENDIF()
-  MESSAGE(${_output})
+  MESSAGE("${_output}")
   MESSAGE("")
   MESSAGE("${TEST}: ******    ${_stage} failed    *******")
   MESSAGE("")

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.