Skip to content
Snippets Groups Projects
Commit d3bd146a authored by Matthias Puchner's avatar Matthias Puchner
Browse files

properly disable tests which contain ParticleDistributions

disable the tests so that CTest lists them as "disabled", instead of just keeping them away from CTest
parent 85b6520e
No related branches found
No related tags found
1 merge request!65Refactor Distribution Handling
Pipeline #36250 passed
......@@ -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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment