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 -------------------------------------------------------