diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 4ee39f675..93b429087 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -116,6 +116,8 @@ function(add_impactx_test name input is_mpi analysis_script plot_script) else() set_property(TEST ${name}.run APPEND PROPERTY ENVIRONMENT "OMP_NUM_THREADS=2") endif() + # special return code for skipped tests (e.g., runtime prerequisite fails) + set_tests_properties(${name}.run PROPERTIES SKIP_RETURN_CODE 42) # analysis and plots set(THIS_Python_SCRIPT_EXE) diff --git a/examples/pytorch_surrogate_model/run_ml_surrogate_15_stage.py b/examples/pytorch_surrogate_model/run_ml_surrogate_15_stage.py index 5a9bb8bdb..85d62fbc2 100644 --- a/examples/pytorch_surrogate_model/run_ml_surrogate_15_stage.py +++ b/examples/pytorch_surrogate_model/run_ml_surrogate_15_stage.py @@ -37,7 +37,7 @@ print("Warning: Cannot import PyTorch. Skipping test.") import sys - sys.exit(0) + sys.exit(42) # ImpactX special return code for skipped tests import zipfile from urllib import request