diff --git a/Tests/Examples/CMakeLists.txt b/Tests/Examples/CMakeLists.txt index 54efffbc978a9dee17490d19780c02d24fa69d99..e3830394fed3874e65fe5bc3b7781eb958801a91 100644 --- a/Tests/Examples/CMakeLists.txt +++ b/Tests/Examples/CMakeLists.txt @@ -27,12 +27,12 @@ endforeach() #################################################################################################### # The following tests contain a particle distribution, which is not supported right now. To keep -# the code for the time once it is newly implemented, the tests are only deactivated, not deleted. +# the code for the time once it is newly implemented, the tests are only disabled, not deleted. #################################################################################################### set (ExampleNamesWithParticleDistribution CylindersWithSizeDistribution TwoTypesOfCylindersWithSizeDistribution - Interference2DLatticeSumOfRotated) + Interference2DLatticeSumOfRotated) set(test_script ${TOOL_DIR}/code/batch-plot.py) @@ -43,11 +43,7 @@ set(test_script ${TOOL_DIR}/code/batch-plot.py) function(run_example example label) get_filename_component(name ${example} NAME_WE) set(test_name Example.run.${name}) - if (${name} IN_LIST ExampleNamesWithParticleDistribution) - message("Test ${test_name} contains ParticleDistribution and will not be executed") - return() - endif() - + add_test(${test_name} env PYTHONPATH=${CMAKE_LIBRARY_OUTPUT_DIRECTORY} BORNAGAIN_EXAMPLE_DATA_DIR=${EXAMPLES_DIR}/data @@ -56,6 +52,9 @@ function(run_example example label) if(NOT label STREQUAL "") set_tests_properties(${test_name} PROPERTIES LABELS ${label}) endif() + if (${name} IN_LIST ExampleNamesWithParticleDistribution) + set_tests_properties(${test_name} PROPERTIES DISABLED TRUE) + endif() endfunction() function(run_examples examples label) @@ -96,10 +95,6 @@ function(test_example example tolerance) get_filename_component(EXAMPLE_DIR ${script_path} DIRECTORY) set(test_name Example.persist.${EXAMPLE_NAME}) - if (${EXAMPLE_NAME} IN_LIST ExampleNamesWithParticleDistribution) - message("Test ${test_name} contains ParticleDistribution and will not be executed") - return() - endif() set(PYPERSIST_TOLERANCE ${tolerance}) @@ -108,6 +103,9 @@ function(test_example example tolerance) configure_file(PyPersistence.py.in ${example_mod} @ONLY) add_test(${test_name} ${Python3_EXECUTABLE} -B ${example_mod}) + if (${EXAMPLE_NAME} IN_LIST ExampleNamesWithParticleDistribution) + set_tests_properties(${test_name} PROPERTIES DISABLED TRUE) + endif() endfunction() test_example(scatter2d/ApproximationDA 2e-10)