From 2eb9239a5d064ee8cbe74eb7334b24e544f8c07b Mon Sep 17 00:00:00 2001 From: Andreas Suter Date: Sun, 18 Oct 2026 20:38:06 +0200 Subject: [PATCH] musrview_check: serialize the tests sharing an msr-file under 'ctest -j'. musrview writes its PNGs next to the msr-file as _.png, hence the plain, -f and -f -a tests of the same msr-file overwrote/removed each other's PNGs when run in parallel. Lock them on the msr-file. --- tests/musrview_check/CMakeLists.txt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/musrview_check/CMakeLists.txt b/tests/musrview_check/CMakeLists.txt index ed835a34..f177c570 100644 --- a/tests/musrview_check/CMakeLists.txt +++ b/tests/musrview_check/CMakeLists.txt @@ -67,6 +67,13 @@ macro(add_musrview_test test_name msr_file) ${ARGN} WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/doc/examples ) + #--- musrview writes its PNGs next to the msr-file under a name derived from + #--- the msr-file only (_.png), hence all tests on the same msr-file + #--- (plain, -f, -f -a) would overwrite/remove each other's PNGs under + #--- 'ctest -j'. Serialize those, tests on different msr-files still run in + #--- parallel. + set_tests_properties(${test_name} PROPERTIES + RESOURCE_LOCK ${CMAKE_SOURCE_DIR}/doc/examples/${msr_file}) endmacro() # add_musrview_test_dir(sub_dir test_name msr_file [extra_musrview_args...]) @@ -86,6 +93,8 @@ macro(add_musrview_test_dir sub_dir test_name msr_file) ${ARGN} WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/doc/examples/${sub_dir} ) + set_tests_properties(${test_name} PROPERTIES + RESOURCE_LOCK ${CMAKE_SOURCE_DIR}/doc/examples/${sub_dir}/${msr_file}) endmacro() #--- doc/examples tests -------------------------------------------------------