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."
#
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