]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Avoid numdiff check race condition in test 5326/head
authorMatthias Maier <tamiko@43-1.org>
Wed, 25 Oct 2017 15:43:43 +0000 (10:43 -0500)
committerMatthias Maier <tamiko@43-1.org>
Wed, 25 Oct 2017 15:43:43 +0000 (10:43 -0500)
Use randomly generated file names for collision free (concurrent) checks
for numdiff support.

Otherwise, if a test subproject is configured concurrently (which might
happen if ctest accidentally triggers a reconfigure due to changed files
in the main project), the following error might occur:
    "The detected numdiff executable was not able to pass a simple relative
    tolerance test."

cmake/macros/macro_deal_ii_pickup_tests.cmake

index 1ce3748519b3a36865b44ed391362fc82ceb6c92..93ad5bc0b1d4653afb1c85f2fe961ceefb0c3c3f 100644 (file)
@@ -149,10 +149,11 @@ MACRO(DEAL_II_PICKUP_TESTS)
   #
   STRING(FIND "${NUMDIFF_EXECUTABLE}" "numdiff" _found_numdiff_binary)
   IF(NOT "${_found_numdiff_binary}" STREQUAL "-1")
+    STRING(RANDOM _suffix)
     SET(_first_test_file_name
-      "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/numdiff-test-1.txt")
+      "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/numdiff-test-${_suffix}-1.txt")
     SET(_second_test_file_name
-      "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/numdiff-test-2.txt")
+      "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/numdiff-test-${_suffix}-2.txt")
     FILE(WRITE "${_first_test_file_name}" "0.99999999998\n2.0\n1.0\n")
     FILE(WRITE "${_second_test_file_name}" "1.00000000001\n2.0\n1.0\n")
 

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.