Skip to content

Commit

Permalink
Use the cmake ExternalData to download the test data (#33)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmcarcell authored Nov 2, 2023
1 parent d008262 commit 91fafab
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 27 deletions.
19 changes: 7 additions & 12 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,25 +25,20 @@ target_include_directories(edm4hep_roundtrip PRIVATE

add_test(NAME edm4hep_roundtrip COMMAND edm4hep_roundtrip)

find_program(BASH_PROGRAM bash)
include(ExternalData)
list(APPEND ExternalData_URL_TEMPLATES
"https://key4hep.web.cern.ch:443/testFiles/k4EDM4hep2LcioConv/%(hash)"
)

add_test(fetch_test_inputs ${BASH_PROGRAM} ${CMAKE_CURRENT_SOURCE_DIR}/scripts/get_test_data.sh)
ExternalData_Add_Test(converter_tests NAME standalone_ild_rec_file COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/scripts/run_standalone_converter.sh DATA{${PROJECT_SOURCE_DIR}/tests/input_files/ild_higgs_rec.slcio})

add_test(standalone_ild_rec_file ${BASH_PROGRAM} ${CMAKE_CURRENT_SOURCE_DIR}/scripts/run_standalone_converter.sh ild_higgs_rec.slcio)

add_test(standalone_ild_dst_file ${BASH_PROGRAM} ${CMAKE_CURRENT_SOURCE_DIR}/scripts/run_standalone_converter.sh ild_higgs_dst.slcio)
ExternalData_Add_Test(converter_tests NAME standalone_ild_dst_file COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/scripts/run_standalone_converter.sh DATA{${PROJECT_SOURCE_DIR}/tests/input_files/ild_higgs_dst.slcio})

set_tests_properties(
fetch_test_inputs
standalone_ild_rec_file
standalone_ild_dst_file
PROPERTIES
ENVIRONMENT "TEST_DIR=${CMAKE_CURRENT_SOURCE_DIR};PATH=${CMAKE_CURRENT_BINARY_DIR}:${PROJECT_BINARY_DIR}/standalone:$ENV{PATH}"
)

set_tests_properties(
standalone_ild_rec_file
standalone_ild_dst_file
PROPERTIES
DEPENDS fetch_test_inputs
)
ExternalData_Add_Target(converter_tests)
1 change: 1 addition & 0 deletions tests/input_files/ild_higgs_dst.slcio
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
43c6052ce40d73cab583682e53f1218e
1 change: 1 addition & 0 deletions tests/input_files/ild_higgs_rec.slcio
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
6f402a67c7c1f4ef62650651426bdf08
15 changes: 0 additions & 15 deletions tests/scripts/get_test_data.sh

This file was deleted.

Empty file modified tests/scripts/run_standalone_converter.sh
100644 → 100755
Empty file.

0 comments on commit 91fafab

Please sign in to comment.