Skip to content

Commit

Permalink
Reorganize tests and remove duplicate scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
tmadlener committed Nov 16, 2021
1 parent 52cee4a commit 25ca380
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 74 deletions.
17 changes: 5 additions & 12 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,24 +60,17 @@ if (BASH_PROGRAM)
PASS_REGULAR_EXPRESSION "INFO Application Manager Terminated successfully")

# Test indicating -1 to go over all events
add_test( all_events_bounds ${BASH_PROGRAM} ${CMAKE_CURRENT_SOURCE_DIR}/scripts/all_events_bounds.sh )
add_test( all_events_bounds ${BASH_PROGRAM} ${CMAKE_CURRENT_SOURCE_DIR}/scripts/test_eof_handling.sh --num-events=-1)
set_tests_properties ( all_events_bounds
PROPERTIES
ENVIRONMENT k4MarlinWrapper_tests_DIR=${CMAKE_CURRENT_SOURCE_DIR}
PASS_REGULAR_EXPRESSION "INFO Application Manager Terminated successfully")
PASS_REGULAR_EXPRESSION "Input and output have same number of events")

# Test putting more events than available, stopping on last available event gracefully
add_test( over_total_events ${BASH_PROGRAM} ${CMAKE_CURRENT_SOURCE_DIR}/scripts/over_total_events.sh )
add_test( over_total_events ${BASH_PROGRAM} ${CMAKE_CURRENT_SOURCE_DIR}/scripts/test_eof_handling.sh --num-events=15 )
set_tests_properties ( over_total_events
PROPERTIES
ENVIRONMENT k4MarlinWrapper_tests_DIR=${CMAKE_CURRENT_SOURCE_DIR}
PASS_REGULAR_EXPRESSION "INFO Application Manager Terminated successfully")

# Test putting more events than available, stopping on last available event gracefully
add_test( same_num_io ${BASH_PROGRAM} ${CMAKE_CURRENT_SOURCE_DIR}/scripts/same_num_io.sh )
set_tests_properties ( same_num_io
PROPERTIES
ENVIRONMENT k4MarlinWrapper_tests_DIR=${CMAKE_CURRENT_SOURCE_DIR}
PASS_REGULAR_EXPRESSION "Input and output have same number of events")

endif(BASH_PROGRAM)
endif(BASH_PROGRAM)
34 changes: 0 additions & 34 deletions test/gaudi_opts/same_num_io.py

This file was deleted.

12 changes: 0 additions & 12 deletions test/scripts/all_events_bounds.sh

This file was deleted.

12 changes: 0 additions & 12 deletions test/scripts/over_total_events.sh

This file was deleted.

5 changes: 3 additions & 2 deletions test/scripts/test_clicReconstruction.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ fi
echo "Modifying clicReconstruction.py file..."
# Replace SLCIO file path
# sed -i 's|/run/simulation/with/ctest/to/create/a/file.slcio|testSimulation.slcio|g' clicReconstruction.py
sed -i 's|/run/simulation/with/ctest/to/create/a/file.slcio|$k4MarlinWrapper_tests_DIR/inputFiles/testSimulation.slcio|g' clicReconstruction.py
sed -i 's|/run/simulation/with/ctest/to/create/a/file.slcio|'"$k4MarlinWrapper_tests_DIR"'/inputFiles/testSimulation.slcio|g' clicReconstruction.py
# Uncomment selected optional processors
sed -i 's;EvtMax = 10,;EvtMax = 3,;' clicReconstruction.py
sed -i 's;"MaxRecordNumber": ["10"],;"MaxRecordNumber": ["3"],;' clicReconstruction.py
Expand All @@ -36,4 +36,5 @@ sed -i 's;"DD4hepXMLFile": \[".*"\],; "DD4hepXMLFile": \[os.environ["LCGEO"]+"/C
# Change output level for correct test confirmation
sed -i 's;OutputLevel=WARNING; OutputLevel=DEBUG;' clicReconstruction.py

../../../run gaudirun.py clicReconstruction.py
echo "Running clicReconstruction.py"
k4run clicReconstruction.py
2 changes: 1 addition & 1 deletion test/scripts/test_converter_constants.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ python \
$k4MarlinWrapper_tests_DIR/inputFiles/testConverterConstants.xml \
$k4MarlinWrapper_tests_DIR/gaudi_opts/testConverterConstants.py

../run gaudirun.py $k4MarlinWrapper_tests_DIR/gaudi_opts/testConverterConstants.py
k4run $k4MarlinWrapper_tests_DIR/gaudi_opts/testConverterConstants.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ if [ ! -f $k4MarlinWrapper_tests_DIR/inputFiles/muons.slcio ]; then
wget https://github.com/AIDASoft/DD4hep/raw/master/DDTest/inputFiles/muons.slcio -P $k4MarlinWrapper_tests_DIR/inputFiles/
fi

../run k4run $k4MarlinWrapper_tests_DIR/gaudi_opts/same_num_io.py --num-events=-1
k4run $k4MarlinWrapper_tests_DIR/gaudi_opts/test_k4MarlinWrapper1.py $@

input_num_events=$(lcio_event_counter $k4MarlinWrapper_tests_DIR/inputFiles/muons.slcio)
output_num_events=$(lcio_event_counter Output_DST.slcio)
Expand Down

0 comments on commit 25ca380

Please sign in to comment.