From cc9717cff580666d28d0fe8a475fbfbd95af42b5 Mon Sep 17 00:00:00 2001 From: Leonhard Reichenbach Date: Fri, 10 Nov 2023 15:05:13 +0100 Subject: [PATCH 1/2] Remove some trailing whitespace --- CMakeLists.txt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d467551ae..a82062b62 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,7 +26,7 @@ set(CMAKE_INSTALL_CMAKEDIR ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}) IF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) SET( CMAKE_INSTALL_PREFIX ${PROJECT_SOURCE_DIR} CACHE PATH - "install prefix path - overwrite with -D CMAKE_INSTALL_PREFIX = ..." + "install prefix path - overwrite with -D CMAKE_INSTALL_PREFIX = ..." FORCE ) MESSAGE(STATUS "CMAKE_INSTALL_PREFIX is ${CMAKE_INSTALL_PREFIX} - overwrite with -D CMAKE_INSTALL_PREFIX" ) ENDIF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) @@ -50,13 +50,13 @@ dd4hep_set_compiler_flags() find_package ( ROOT REQUIRED COMPONENTS Geom GenVector) message ( STATUS "ROOT_VERSION: ${ROOT_VERSION}" ) -find_package( Geant4 REQUIRED ) +find_package( Geant4 REQUIRED ) find_package( LCIO REQUIRED) add_subdirectory(detectorSegmentations) add_subdirectory(detectorCommon) -file(GLOB sources +file(GLOB sources ./detector/tracker/*.cpp ./detector/calorimeter/*.cpp ./detector/fcal/*.cpp @@ -106,8 +106,8 @@ endif(BUILD_TESTING) #--- install remaining targets-------------------------- FILE(GLOB hfiles "ILD/include/*.h") -INSTALL(FILES ${hfiles} - DESTINATION include/${PackageName} +INSTALL(FILES ${hfiles} + DESTINATION include/${PackageName} ) #--- install compact files------------------------------ From 48a7511bc754eb0b358e01cdec4edb7ead866422 Mon Sep 17 00:00:00 2001 From: Leonhard Reichenbach Date: Fri, 10 Nov 2023 15:05:21 +0100 Subject: [PATCH 2/2] Make tests usable without install --- CMakeLists.txt | 2 +- lcgeoTests/CMakeLists.txt | 48 +++++++++++++++++++-------------------- 2 files changed, 24 insertions(+), 26 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a82062b62..d336cc288 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.12 FATAL_ERROR) +cmake_minimum_required(VERSION 3.20 FATAL_ERROR) #--------------------------- set( PackageName k4geo ) diff --git a/lcgeoTests/CMakeLists.txt b/lcgeoTests/CMakeLists.txt index 909fbdee6..1fe09b7f6 100644 --- a/lcgeoTests/CMakeLists.txt +++ b/lcgeoTests/CMakeLists.txt @@ -1,7 +1,7 @@ #-------------------------------------------------- -configure_file( ${DD4hep_ROOT}/cmake/run_test_package.sh run_test_${PackageName}.sh @ONLY) +configure_file( ${DD4hep_ROOT}/cmake/run_test_package.sh run_test_${PackageName}.sh FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE @ONLY) INSTALL(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/run_test_${PackageName}.sh DESTINATION bin ) @@ -11,78 +11,78 @@ INSTALL(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/run_test_${PackageName}.sh #-------------------------------------------------- # test(s) for ILD SET( test_name "test_ILD_l5_v02" ) -ADD_TEST( t_${test_name} "${CMAKE_INSTALL_PREFIX}/bin/run_test_${PackageName}.sh" +ADD_TEST( t_${test_name} "${CMAKE_CURRENT_BINARY_DIR}/run_test_${PackageName}.sh" ddsim --compactFile=${CMAKE_CURRENT_SOURCE_DIR}/../ILD/compact/ILD_l5_v02/ILD_l5_v02.xml --runType=batch -G -N=1 --outputFile=testILD_l5_v02.slcio ) SET_TESTS_PROPERTIES( t_${test_name} PROPERTIES FAIL_REGULAR_EXPRESSION "Exception;EXCEPTION;ERROR;Error" ) SET( test_name "test_ILD_s5_v02" ) -ADD_TEST( t_${test_name} "${CMAKE_INSTALL_PREFIX}/bin/run_test_${PackageName}.sh" +ADD_TEST( t_${test_name} "${CMAKE_CURRENT_BINARY_DIR}/run_test_${PackageName}.sh" ddsim --compactFile=${CMAKE_CURRENT_SOURCE_DIR}/../ILD/compact/ILD_s5_v02/ILD_s5_v02.xml --runType=batch -G -N=1 --outputFile=testILD_s5_v02.slcio ) SET_TESTS_PROPERTIES( t_${test_name} PROPERTIES FAIL_REGULAR_EXPRESSION "Exception;EXCEPTION;ERROR;Error" ) SET( test_name "test_ILD_l5_v09" ) -ADD_TEST( t_${test_name} "${CMAKE_INSTALL_PREFIX}/bin/run_test_${PackageName}.sh" +ADD_TEST( t_${test_name} "${CMAKE_CURRENT_BINARY_DIR}/run_test_${PackageName}.sh" ddsim --compactFile=${CMAKE_CURRENT_SOURCE_DIR}/../ILD/compact/ILD_l5_v09/ILD_l5_v09.xml --runType=batch -G -N=1 --outputFile=testILD_l5_v09.slcio ) SET_TESTS_PROPERTIES( t_${test_name} PROPERTIES FAIL_REGULAR_EXPRESSION "Exception;EXCEPTION;ERROR;Error" ) SET( test_name "test_ILD_l5_v10" ) -ADD_TEST( t_${test_name} "${CMAKE_INSTALL_PREFIX}/bin/run_test_${PackageName}.sh" +ADD_TEST( t_${test_name} "${CMAKE_CURRENT_BINARY_DIR}/run_test_${PackageName}.sh" ddsim --compactFile=${CMAKE_CURRENT_SOURCE_DIR}/../ILD/compact/ILD_l5_v10/ILD_l5_v10.xml --runType=batch -G -N=1 --outputFile=testILD_l5_v10.slcio ) SET_TESTS_PROPERTIES( t_${test_name} PROPERTIES FAIL_REGULAR_EXPRESSION "Exception;EXCEPTION;ERROR;Error" ) SET( test_name "test_ILD_l5_v11" ) -ADD_TEST( t_${test_name} "${CMAKE_INSTALL_PREFIX}/bin/run_test_${PackageName}.sh" +ADD_TEST( t_${test_name} "${CMAKE_CURRENT_BINARY_DIR}/run_test_${PackageName}.sh" ddsim --compactFile=${CMAKE_CURRENT_SOURCE_DIR}/../ILD/compact/ILD_l5_v11/ILD_l5_v11.xml --runType=batch -G -N=1 --outputFile=testILD_l5_v11.slcio ) SET_TESTS_PROPERTIES( t_${test_name} PROPERTIES FAIL_REGULAR_EXPRESSION "Exception;EXCEPTION;ERROR;Error" ) #-------------------------------------------------- # tests for SiD SET( test_name "test_SiD_o2_v03" ) -ADD_TEST( t_${test_name} "${CMAKE_INSTALL_PREFIX}/bin/run_test_${PackageName}.sh" +ADD_TEST( t_${test_name} "${CMAKE_CURRENT_BINARY_DIR}/run_test_${PackageName}.sh" ddsim --compactFile=${CMAKE_CURRENT_SOURCE_DIR}/../SiD/compact/SiD_o2_v03/SiD_o2_v03.xml --runType=batch -G -N=1 --outputFile=testSiD_o2_v03.slcio ) SET_TESTS_PROPERTIES( t_${test_name} PROPERTIES FAIL_REGULAR_EXPRESSION "Exception;EXCEPTION;ERROR;Error" ) SET( test_name "test_SiD_o2_v04" ) -ADD_TEST( t_${test_name} "${CMAKE_INSTALL_PREFIX}/bin/run_test_${PackageName}.sh" +ADD_TEST( t_${test_name} "${CMAKE_CURRENT_BINARY_DIR}/run_test_${PackageName}.sh" ddsim --compactFile=${CMAKE_CURRENT_SOURCE_DIR}/../SiD/compact/SiD_o2_v04/SiD_o2_v04.xml --runType=batch -G -N=1 --outputFile=testSiD_o2_v04.slcio ) SET_TESTS_PROPERTIES( t_${test_name} PROPERTIES FAIL_REGULAR_EXPRESSION "Exception;EXCEPTION;ERROR;Error" ) #-------------------------------------------------- # test for CLIC_o1_v01 SET( test_name "test_CLIC_o1_v01" ) -ADD_TEST( t_${test_name} "${CMAKE_INSTALL_PREFIX}/bin/run_test_${PackageName}.sh" +ADD_TEST( t_${test_name} "${CMAKE_CURRENT_BINARY_DIR}/run_test_${PackageName}.sh" ddsim --compactFile=${CMAKE_CURRENT_SOURCE_DIR}/../CLIC/compact/CLIC_o1_v01/CLIC_o1_v01.xml --runType=batch -G -N=1 --outputFile=testCLIC.slcio ) SET_TESTS_PROPERTIES( t_${test_name} PROPERTIES FAIL_REGULAR_EXPRESSION "Exception;EXCEPTION;ERROR;Error" ) SET( test_name "test_CLIC_o2_v04" ) -ADD_TEST( t_${test_name} "${CMAKE_INSTALL_PREFIX}/bin/run_test_${PackageName}.sh" +ADD_TEST( t_${test_name} "${CMAKE_CURRENT_BINARY_DIR}/run_test_${PackageName}.sh" ddsim --compactFile=${CMAKE_CURRENT_SOURCE_DIR}/../CLIC/compact/CLIC_o2_v04/CLIC_o2_v04.xml --runType=batch -G -N=1 --outputFile=testCLIC_o2_v04.slcio ) SET_TESTS_PROPERTIES( t_${test_name} PROPERTIES FAIL_REGULAR_EXPRESSION "Exception;EXCEPTION;ERROR;Error" ) SET( test_name "test_CLIC_o3_v15" ) -ADD_TEST( t_${test_name} "${CMAKE_INSTALL_PREFIX}/bin/run_test_${PackageName}.sh" +ADD_TEST( t_${test_name} "${CMAKE_CURRENT_BINARY_DIR}/run_test_${PackageName}.sh" ddsim --compactFile=${CMAKE_CURRENT_SOURCE_DIR}/../CLIC/compact/CLIC_o3_v15/CLIC_o3_v15.xml --runType=batch -G -N=1 --outputFile=testCLIC_o3_v15.slcio ) SET_TESTS_PROPERTIES( t_${test_name} PROPERTIES FAIL_REGULAR_EXPRESSION "Exception;EXCEPTION;ERROR;Error" ) SET( test_name "test_FCCee_o1_v05" ) -ADD_TEST( t_${test_name} "${CMAKE_INSTALL_PREFIX}/bin/run_test_${PackageName}.sh" +ADD_TEST( t_${test_name} "${CMAKE_CURRENT_BINARY_DIR}/run_test_${PackageName}.sh" ddsim --compactFile=${CMAKE_CURRENT_SOURCE_DIR}/../FCCee/CLD/compact/FCCee_o1_v05/FCCee_o1_v05.xml --runType=batch -G -N=1 --outputFile=testFCCee_o1_v05.slcio ) SET_TESTS_PROPERTIES( t_${test_name} PROPERTIES FAIL_REGULAR_EXPRESSION "Exception;EXCEPTION;ERROR;Error" ) SET( det_name "CLD_o2_v05" ) -ADD_TEST( t_test_${det_name} "${CMAKE_INSTALL_PREFIX}/bin/run_test_${PackageName}.sh" +ADD_TEST( t_test_${det_name} "${CMAKE_CURRENT_BINARY_DIR}/run_test_${PackageName}.sh" ddsim --compactFile=${CMAKE_CURRENT_SOURCE_DIR}/../FCCee/CLD/compact/${det_name}/${det_name}.xml --runType=batch -G -N=1 --outputFile=test${det_name}.slcio ) SET_TESTS_PROPERTIES( t_test_${det_name} PROPERTIES FAIL_REGULAR_EXPRESSION "Exception;EXCEPTION;ERROR;Error" ) SET( test_name "test_steeringFile" ) -ADD_TEST( t_${test_name} "${CMAKE_INSTALL_PREFIX}/bin/run_test_${PackageName}.sh" +ADD_TEST( t_${test_name} "${CMAKE_CURRENT_BINARY_DIR}/run_test_${PackageName}.sh" ddsim --steeringFile=${CMAKE_CURRENT_SOURCE_DIR}/../example/steeringFile.py --compactFile=${CMAKE_CURRENT_SOURCE_DIR}/../CLIC/compact/CLIC_o2_v04/CLIC_o2_v04.xml --runType=batch -G -N=1 --outputFile=testCLIC_o2_v04.slcio ) SET_TESTS_PROPERTIES( t_${test_name} PROPERTIES FAIL_REGULAR_EXPRESSION "Exception;EXCEPTION;ERROR;Error" ) #-------------------------------------------------- # test for IDEA o1 v02 SET( test_name "test_IDEA_o1_v02" ) -ADD_TEST( t_${test_name} "${CMAKE_INSTALL_PREFIX}/bin/run_test_${PackageName}.sh" +ADD_TEST( t_${test_name} "${CMAKE_CURRENT_BINARY_DIR}/run_test_${PackageName}.sh" ddsim --compactFile=${CMAKE_CURRENT_SOURCE_DIR}/../FCCee/IDEA/compact/IDEA_o1_v02/IDEA_o1_v02.xml --runType=batch -G -N=1 --outputFile=testIDEA_o1_v02.slcio ) SET_TESTS_PROPERTIES( t_${test_name} PROPERTIES FAIL_REGULAR_EXPRESSION "Exception;EXCEPTION;ERROR;Error" TIMEOUT 240) @@ -97,15 +97,13 @@ SET_TESTS_PROPERTIES( t_${test_name} PROPERTIES FAIL_REGULAR_EXPRESSION "Except # test for ARC o1 v01 SET( test_name "test_ARC_o1_v01_run" ) ADD_TEST( t_${test_name} "${CMAKE_INSTALL_PREFIX}/bin/run_test_${PackageName}.sh" - python3 ${CMAKE_CURRENT_SOURCE_DIR}/../example/arcfullsim.py --compactFile=${CMAKE_CURRENT_SOURCE_DIR}/compact/ARC_standalone_o1_v01.xml --runType batch ) -SET_TESTS_PROPERTIES( t_${test_name} PROPERTIES FAIL_REGULAR_EXPRESSION " Exception;EXCEPTION;ERROR;Error" ) -set_tests_properties( t_${test_name} PROPERTIES TIMEOUT 120) + python3 ${CMAKE_CURRENT_SOURCE_DIR}/../example/arcfullsim.py --compactFile=${CMAKE_CURRENT_SOURCE_DIR}/../FCCee/CLD/compact/CLD_o3_v01/CLD_o3_v01.xml --runType batch ) +SET_TESTS_PROPERTIES( t_${test_name} PROPERTIES FAIL_REGULAR_EXPRESSION " Exception;EXCEPTION;ERROR;Error" TIMEOUT 120) SET( test_name "test_ARC_o1_v01_overlap" ) ADD_TEST( t_${test_name} "${CMAKE_INSTALL_PREFIX}/bin/run_test_${PackageName}.sh" - ddsim --compactFile=${CMAKE_CURRENT_SOURCE_DIR}/compact/ARC_standalone_o1_v01.xml --runType run --part.userParticleHandler= --macroFile=${CMAKE_CURRENT_SOURCE_DIR}/../utils/overlap.mac ) -SET_TESTS_PROPERTIES( t_${test_name} PROPERTIES FAIL_REGULAR_EXPRESSION "Exception;EXCEPTION;ERROR;Error" ) -set_tests_properties( t_${test_name} PROPERTIES TIMEOUT 360) + ddsim --compactFile=${CMAKE_CURRENT_SOURCE_DIR}/../FCCee/CLD/compact/CLD_o3_v01/CLD_o3_v01.xml --runType run --part.userParticleHandler= --macroFile=${CMAKE_CURRENT_SOURCE_DIR}/../utils/overlap.mac ) +SET_TESTS_PROPERTIES( t_${test_name} PROPERTIES FAIL_REGULAR_EXPRESSION "Exception;EXCEPTION;ERROR;Error" TIMEOUT 240) #-------------------------------------------------- @@ -117,7 +115,7 @@ ADD_EXECUTABLE( BeamCalZtest src/BeamCalZtest.cpp ) Target_Link_Libraries( BeamCalZtest lcgeo ) INSTALL( TARGETS BeamCalZtest DESTINATION bin ) -ADD_TEST( t_SensThickness_Clic_o2_v4 "${CMAKE_INSTALL_PREFIX}/bin/run_test_${PackageName}.sh" - ${CMAKE_INSTALL_PREFIX}/bin/TestSensThickness ${CMAKE_CURRENT_SOURCE_DIR}/../CLIC/compact/CLIC_o2_v04/CLIC_o2_v04.xml 300 50 ) -ADD_TEST( t_SensThickness_CLIC_o3_v15 "${CMAKE_INSTALL_PREFIX}/bin/run_test_${PackageName}.sh" - ${CMAKE_INSTALL_PREFIX}/bin/TestSensThickness ${CMAKE_CURRENT_SOURCE_DIR}/../CLIC/compact/CLIC_o3_v15/CLIC_o3_v15.xml 100 50 ) +ADD_TEST( t_SensThickness_Clic_o2_v4 "${CMAKE_CURRENT_BINARY_DIR}/run_test_${PackageName}.sh" + ${CMAKE_BINARY_DIR}/bin/TestSensThickness ${CMAKE_CURRENT_SOURCE_DIR}/../CLIC/compact/CLIC_o2_v04/CLIC_o2_v04.xml 300 50 ) +ADD_TEST( t_SensThickness_CLIC_o3_v15 "${CMAKE_CURRENT_BINARY_DIR}/run_test_${PackageName}.sh" + ${CMAKE_BINARY_DIR}/bin/TestSensThickness ${CMAKE_CURRENT_SOURCE_DIR}/../CLIC/compact/CLIC_o3_v15/CLIC_o3_v15.xml 100 50 )