From 9167bc006aee84b3f7b05cee16a8656b17b03591 Mon Sep 17 00:00:00 2001 From: tmadlener Date: Tue, 10 Sep 2024 12:57:13 +0200 Subject: [PATCH] Rename tests to make it easier to define dependencies --- test/CMakeLists.txt | 10 +++++----- test/backwards_compat/CMakeLists.txt | 11 ++++------- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 3d8965e16..f83a6f544 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -13,12 +13,12 @@ function(set_test_env _testname) ) endfunction() -add_test(NAME "Create an EDM4hep data file" COMMAND python ${PROJECT_SOURCE_DIR}/scripts/createEDM4hepFile.py --output-file edm4hep_example.root) -set_test_env("Create an EDM4hep data file") +add_test(NAME create_complete_file COMMAND python ${PROJECT_SOURCE_DIR}/scripts/createEDM4hepFile.py --output-file edm4hep_example.root) +set_test_env(create_complete_file) -add_test(NAME "Create an EDM4hep data file (RNTuple)" COMMAND python ${PROJECT_SOURCE_DIR}/scripts/createEDM4hepFile.py --rntuple --output-file edm4hep_example_rntuple.root) -set_test_env("Create an EDM4hep data file (RNTuple)") -set_tests_properties("Create an EDM4hep data file (RNTuple)" PROPERTIES +add_test(NAME create_complete_file_rntuple COMMAND python ${PROJECT_SOURCE_DIR}/scripts/createEDM4hepFile.py --rntuple --output-file edm4hep_example_rntuple.root) +set_test_env(create_complete_file_rntuple) +set_tests_properties(create_complete_file_rntuple PROPERTIES SKIP_REGULAR_EXPRESSION "The RNTuple writer from podio is not available but was requested" ) diff --git a/test/backwards_compat/CMakeLists.txt b/test/backwards_compat/CMakeLists.txt index e10438322..a03b88ef3 100644 --- a/test/backwards_compat/CMakeLists.txt +++ b/test/backwards_compat/CMakeLists.txt @@ -1,22 +1,19 @@ add_test(NAME check_complete_file COMMAND pytest --inputfile=${CMAKE_BINARY_DIR}/test/edm4hep_example.root -v) - -add_test(NAME check_complete_file_rntuple COMMAND pytest --inputfile=${CMAKE_BINARY_DIR}/test/edm4hep_example_rntuple.root -v) - set_test_env(check_complete_file) -set_test_env(check_complete_file_rntuple) - set_tests_properties( check_complete_file PROPERTIES - DEPENDS "Create an EDM4hep data file" + DEPENDS create_complete_file WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} ) +add_test(NAME check_complete_file_rntuple COMMAND pytest --inputfile=${CMAKE_BINARY_DIR}/test/edm4hep_example_rntuple.root -v) +set_test_env(check_complete_file_rntuple) set_tests_properties( check_complete_file_rntuple PROPERTIES - DEPENDS "Create an EDM4hep data file (RNtuple)" + DEPENDS create_complete_file_rntuple WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} )