diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index f83a6f544..dc2b0af33 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -22,6 +22,25 @@ set_tests_properties(create_complete_file_rntuple PROPERTIES SKIP_REGULAR_EXPRESSION "The RNTuple writer from podio is not available but was requested" ) +add_test(NAME check_complete_file COMMAND pytest --inputfile=${CMAKE_BINARY_DIR}/test/edm4hep_example.root -v) +set_test_env(check_complete_file) +set_tests_properties( + check_complete_file + + PROPERTIES + 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_complete_file_rntuple + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} +) + add_executable(write_events write_events.cc) target_include_directories(write_events PUBLIC ${PROJECT_SOURCE_DIR}/edm4hep ) target_link_libraries(write_events edm4hep podio::podioRootIO) @@ -96,4 +115,6 @@ endif() add_subdirectory(utils) add_subdirectory(tools) + + add_subdirectory(backwards_compat) diff --git a/test/backwards_compat/CMakeLists.txt b/test/backwards_compat/CMakeLists.txt deleted file mode 100644 index a03b88ef3..000000000 --- a/test/backwards_compat/CMakeLists.txt +++ /dev/null @@ -1,19 +0,0 @@ -add_test(NAME check_complete_file COMMAND pytest --inputfile=${CMAKE_BINARY_DIR}/test/edm4hep_example.root -v) -set_test_env(check_complete_file) -set_tests_properties( - check_complete_file - - PROPERTIES - 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_complete_file_rntuple - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} -) diff --git a/test/backwards_compat/conftest.py b/test/backwards_compat/conftest.py deleted file mode 100644 index 3e8283bf2..000000000 --- a/test/backwards_compat/conftest.py +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env python3 -"""pytest config module to make passing of input file name possible""" - - -def pytest_addoption(parser): - parser.addoption("--inputfile", action="store", default="heeeeyyyoooo") diff --git a/test/conftest.py b/test/conftest.py new file mode 100644 index 000000000..eacd06cd0 --- /dev/null +++ b/test/conftest.py @@ -0,0 +1,8 @@ +#!/usr/bin/env python3 +"""pytest config module to make passing of input file name possible""" + + +def pytest_addoption(parser): + """Hook to add an inputfile argument to pytest for checking EDM4hep file + contents""" + parser.addoption("--inputfile", action="store") diff --git a/test/backwards_compat/test_EDM4hepFile.py b/test/test_EDM4hepFile.py similarity index 99% rename from test/backwards_compat/test_EDM4hepFile.py rename to test/test_EDM4hepFile.py index b154a7c69..a34a83364 100644 --- a/test/backwards_compat/test_EDM4hepFile.py +++ b/test/test_EDM4hepFile.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 -"""Script that can be used to check whether the file that has been created by -scripts/createEDM4hepFile.py has the expected contents +"""Pytest module that can be used to check whether the file that has been +created by scripts/createEDM4hepFile.py has the expected contents """ import os