Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rework tests #10

Merged
merged 3 commits into from
Oct 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@ jobs:
- name: Checkout
uses: actions/checkout@v3

- name: Download test inputs
run: |
wget http://lreichen.webtest.cern.ch/test.slcio

- name: Start container
run: |
docker run \
Expand All @@ -31,5 +27,6 @@ jobs:
run: |
docker exec CLDConfig_CI /bin/bash -c 'source ${{ matrix.SETUP }};
cd CLDConfig;
pytest;
cmake .;
ctest --output-on-failure;
'
22 changes: 22 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#[[
Copyright (c) 2014-2023 Key4hep-Project.

This file is part of Key4hep.
See https://key4hep.github.io/key4hep-doc/ for further info.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
]]
project(CLDConfig)

add_subdirectory(test)
enable_testing()
21 changes: 21 additions & 0 deletions test/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
### CMake ###
CMakeLists.txt.user
CMakeCache.txt
CMakeFiles
CMakeScripts
Testing
Makefile
cmake_install.cmake
install_manifest.txt
compile_commands.json
CTestTestfile.cmake
_deps

### CMake Patch ###
# External projects
*-prefix/

### other ###
*.root
*.slcio
build/*
45 changes: 45 additions & 0 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#[[
Copyright (c) 2014-2023 Key4hep-Project.

This file is part of Key4hep.
See https://key4hep.github.io/key4hep-doc/ for further info.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
]]
include(CTest)

set(DETECTOR $ENV{K4GEO}/FCCee/CLD/compact/FCCee_o1_v04/FCCee_o1_v04.xml)
set(CLDConfig_DIR ${CMAKE_CURRENT_LIST_DIR}/../CLDConfig)

add_test(NAME ddsim_lcio
WORKING_DIRECTORY ${CLDConfig_DIR}
COMMAND ddsim -S cld_steer.py -N 3 --inputFile ../test/yyxyev_000.stdhep --outputFile test.slcio --compactFile ${DETECTOR}
)

# FIXME: need to call k4run from CLDConfig dir where the pandora config lives
add_test(NAME lcio_input
WORKING_DIRECTORY ${CLDConfig_DIR}
COMMAND k4run --inputFiles=test.slcio --outputBasename=rec_test_lcio CLDReconstruction.py --GeoSvc.detectors=${DETECTOR}
)
set_property(TEST lcio_input APPEND PROPERTY DEPENDS ddsim_lcio)

add_test(NAME ddsim_edm4hep
WORKING_DIRECTORY ${CLDConfig_DIR}
COMMAND ddsim -S cld_steer.py -N 3 --inputFile ../test/yyxyev_000.stdhep --outputFile test.edm4hep.root --compactFile ${DETECTOR}
)

add_test(NAME edm4hep_input
WORKING_DIRECTORY ${CLDConfig_DIR}
COMMAND k4run --inputFiles=test.edm4hep.root --outputBasename=rec_test_edm4hep CLDReconstruction.py --GeoSvc.detectors=${DETECTOR}
)
set_property(TEST edm4hep_input APPEND PROPERTY DEPENDS ddsim_edm4hep)
36 changes: 0 additions & 36 deletions test/test_CLDConfig.py

This file was deleted.

Binary file added test/yyxyev_000.stdhep
Binary file not shown.
Loading