Skip to content

Commit

Permalink
move to ctest
Browse files Browse the repository at this point in the history
  • Loading branch information
Zehvogel authored and andresailer committed Oct 24, 2023
1 parent 3c12fc3 commit 4689c24
Show file tree
Hide file tree
Showing 5 changed files with 90 additions and 63 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,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)
62 changes: 0 additions & 62 deletions test/test_CLDConfig.py

This file was deleted.

0 comments on commit 4689c24

Please sign in to comment.