Skip to content

Commit

Permalink
Use the cmake ExternalData to download the test data
Browse files Browse the repository at this point in the history
  • Loading branch information
jmcarcell committed Nov 1, 2023
1 parent d008262 commit 03c3702
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 26 deletions.
19 changes: 8 additions & 11 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,25 +25,22 @@ 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)
find_program(BASH_PROGRAM bash)

add_test(standalone_ild_rec_file ${BASH_PROGRAM} ${CMAKE_CURRENT_SOURCE_DIR}/scripts/run_standalone_converter.sh ild_higgs_rec.slcio)
ExternalData_Add_Test(standalone_ild_rec_file ${BASH_PROGRAM} ${CMAKE_CURRENT_SOURCE_DIR}/scripts/run_standalone_converter.sh DATA{${PROJECT_SOURCE_DIR}/tests/input_files/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(standalone_ild_dst_file ${BASH_PROGRAM} ${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.

0 comments on commit 03c3702

Please sign in to comment.