]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Testsuite: Bugfix: Fix mpi tests 1479/head
authorMatthias Maier <tamiko@43-1.org>
Mon, 31 Aug 2015 01:17:13 +0000 (20:17 -0500)
committerMatthias Maier <tamiko@43-1.org>
Mon, 31 Aug 2015 01:17:13 +0000 (20:17 -0500)
MPI test results and diffs are stored at a different location than the
files for ordinary tests. Fix run_test.cmake to take that into account.

Safeguard against possible further changes by checking whether we have
guessed the location correctly prior to reading the diff file. We output
the file contents (which is either empty or explains against which variant
we successfully compared) for informational reasons anyway...

cmake/scripts/run_test.cmake

index 242411c50732e985589f23004b24900b86f5139a..2ba1fc8881b22115ef7fd3cd1ae5b0b5af0cce80 100644 (file)
@@ -91,7 +91,21 @@ MESSAGE("===============================   OUTPUT BEGIN  =======================
 
 IF("${_stage}" STREQUAL "PASSED")
   STRING(REGEX REPLACE ".*\\/" "" _test ${TEST})
-  FILE(READ ${BINARY_DIR}/${_test}/diff _diff)
+  #
+  # MPI tests have a special runtime directory so rename:
+  # test.mpirun=X.BUILD -> test.BUILD/mpirun=X
+  #
+  STRING(REGEX REPLACE "\\.(mpirun=[0-9]+)(\\..*)" "\\2/\\1" _test ${_test})
+  #
+  # Also output the diff file if we guessed the location correctly. This is
+  # solely for cosmetic reasons: The diff file is either empty (if
+  # comparison against the main comparison file was successful) or contains
+  # a string explaining which comparison file variant succeeded.
+  #
+  SET(_diff "")
+  IF(EXISTS ${BINARY_DIR}/${_test}/diff)
+    FILE(READ ${BINARY_DIR}/${_test}/diff _diff)
+  ENDIF()
   MESSAGE("${_diff}${TEST}: PASSED.")
 
 ELSE()

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.