From: Matthias Maier Date: Wed, 25 Oct 2017 15:43:43 +0000 (-0500) Subject: Avoid numdiff check race condition in test X-Git-Tag: v9.0.0-rc1~880^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=66be5a5776eb37897001fea2a21184c3e83b5d3f;p=dealii.git Avoid numdiff check race condition in test 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." --- diff --git a/cmake/macros/macro_deal_ii_pickup_tests.cmake b/cmake/macros/macro_deal_ii_pickup_tests.cmake index 1ce3748519..93ad5bc0b1 100644 --- a/cmake/macros/macro_deal_ii_pickup_tests.cmake +++ b/cmake/macros/macro_deal_ii_pickup_tests.cmake @@ -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")