-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add automated test cases for standalone converter and also check rela…
…tions (#28)
- Loading branch information
Showing
12 changed files
with
698 additions
and
132 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,31 @@ | ||
add_library(edmCompare SHARED src/CompareEDM4hepLCIO.cc) | ||
add_library(edmCompare SHARED src/CompareEDM4hepLCIO.cc src/ObjectMapping.cc) | ||
target_link_libraries(edmCompare PUBLIC EDM4HEP::edm4hep ${LCIO_LIBRARIES}) | ||
target_include_directories(edmCompare PUBLIC ${LCIO_INCLUDE_DIRS}) | ||
|
||
add_executable(compare-contents compare_contents.cpp) | ||
target_link_libraries(compare-contents PRIVATE edmCompare podio::podioRootIO) | ||
target_include_directories(compare-contents PRIVATE | ||
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/src>) | ||
|
||
find_program(BASH_PROGRAM bash) | ||
|
||
add_test(fetch_test_inputs ${BASH_PROGRAM} ${CMAKE_CURRENT_SOURCE_DIR}/scripts/get_test_data.sh) | ||
|
||
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) | ||
|
||
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 | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -eu | ||
|
||
TEST_INPUT_DIR=${TEST_DIR}/inputFiles | ||
mkdir -p ${TEST_INPUT_DIR} | ||
|
||
TEST_FILES=("ild_higgs_rec.slcio" "ild_higgs_dst.slcio") | ||
|
||
for input_file in ${TEST_FILES[@]}; do | ||
if [ ! -f ${TEST_INPUT_DIR}/${input_file} ]; then | ||
echo "${input_file} test input file not yet present. Fetching it" | ||
wget https://key4hep.web.cern.ch/testFiles/k4EDM4hep2LcioConv/ILD/${input_file} -P ${TEST_INPUT_DIR} | ||
fi | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -eu | ||
|
||
input_file_base=${1} | ||
|
||
TEST_INPUT_DIR=${TEST_DIR}/inputFiles | ||
TEST_OUTPUT_DIR=testOutputs | ||
mkdir -p ${TEST_OUTPUT_DIR} | ||
|
||
input_file=${TEST_INPUT_DIR}/${input_file_base} | ||
output_file=${TEST_OUTPUT_DIR}/${input_file_base/.slcio/.edm4hep.root} | ||
patch_file=${TEST_OUTPUT_DIR}/${input_file_base/.slcio/_colls.txt} | ||
|
||
echo "Creating the patch file for the standalone converter" | ||
check_missing_cols --minimal ${input_file} > ${patch_file} | ||
|
||
echo "Running the standalone converter" | ||
lcio2edm4hep ${input_file} ${output_file} ${patch_file} | ||
|
||
echo "Comparing the converted and original contents" | ||
compare-contents ${input_file} ${output_file} |
Oops, something went wrong.