diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e88e0d23c0425f735a7dd0782f2e60ced6f37d18..1e2b81caa54e8ea45d532e37b5efcc5b83602d73 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2,6 +2,12 @@ image: corsika/devel:u-18.04 variables: GIT_SSL_NO_VERIFY: "1" + ## Runtime options for sanitizers + # (detect_leaks=0 because leak detection doesn't work in CI, but you can + # try to test with leak detection locally by using detect_leaks=1) + UBSAN_OPTIONS: "print_stacktrace=1" + LSAN_OPTIONS: "log_threads=1" + ASAN_OPTIONS: "detect_leaks=0:detect_stack_use_after_return=1" build: stage: build @@ -11,7 +17,7 @@ build: - mkdir build - cd build - cmake .. - - cmake --build . -- -j 4 + - cmake --build . -- -j 4 - ctest -j4 -V >& test.log after_script: - cd build diff --git a/CMakeLists.txt b/CMakeLists.txt index 6d82cd880d4adfa44d55a2fbf937cf3c04c215f3..d473fb79a80f45214da6e9c29a91fa69b0057052 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,6 +13,9 @@ enable_language (Fortran) # ignore many irrelevant Up-to-date messages during install set (CMAKE_INSTALL_MESSAGE LAZY) +# TEMPORARY: this should be removed, the sanitizers should be always enabled +option(CORSIKA_SANITIZERS_ENABLED "temporary way to globally disable sanitizers until the currently failing tests are fixed" OFF) + # directory for local cmake modules set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/CMakeModules) include (CorsikaUtilities) # a few cmake function diff --git a/CMakeModules/CorsikaUtilities.cmake b/CMakeModules/CorsikaUtilities.cmake index 9b00787289f634872b707c208cc899136418d597..ad853b8d1c5c48c94761c7edbcaccbf25427ca45 100644 --- a/CMakeModules/CorsikaUtilities.cmake +++ b/CMakeModules/CorsikaUtilities.cmake @@ -95,11 +95,61 @@ endmacro(CORSIKA_ADD_FILES_ABSOLUTE) ################################################# # -# central macro to activate unit tests in cmake +# central macro to register unit tests in cmake # +# 1) Simple use: +# Pass the name of the test.cc file as the first +# argument, without the ".cc" extention. +# +# Example: CORSIKA_ADD_TEST (testSomething) +# +# This generates target testSomething from file testSomething.cc. +# +# 2) Customize sources: +# If 1) doesn't work, use the SOURCES keyword to explicitly +# specify the sources. +# +# Example: CORSIKA_ADD_TEST (testSomething +# SOURCES source1.cc source2.cc someheader.h) +# +# 3) Customize sanitizers: +# You can override which sanitizers are compiled into the +# test, but only do this if the defaults do not work. +# +# Example: CORSIKA_ADD_TEST (testSomething SANITIZE undefined) +# +# Only uses the sanitizer for undefined behavior. +# +# In all cases, you can further customize the target with +# target_link_libraries(testSomething ...) and so on. +# +# TEMPORARY: All sanitizers are currently globally disabled by default, to enable them, +# set CORSIKA_SANITIZERS_ENABLED to TRUE. +function (CORSIKA_ADD_TEST) + cmake_parse_arguments(PARSE_ARGV 1 _ "" "SANITIZE" "SOURCES") + + set(name ${ARGV0}) + + if (NOT __SOURCES) + set(sources ${name}.cc) + else() + set(sources ${__SOURCES}) + endif() -function (CORSIKA_ADD_TEST name) + if (NOT __SANITIZE) + set(sanitize "address,undefined") + else() + set(sanitize ${__SANITIZE}) + endif() + + add_executable(${name} ${sources}) + target_compile_options(${name} PRIVATE -g) # do not skip asserts target_include_directories (${name} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) file (MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/test_outputs/) + if (CORSIKA_SANITIZERS_ENABLED) + # -O1 is suggested in clang docs to get reasonable performance + target_compile_options(${name} PRIVATE -O1 -fno-omit-frame-pointer -fsanitize=${sanitize} -fno-sanitize-recover=all) + set_target_properties(${name} PROPERTIES LINK_FLAGS "-fsanitize=${sanitize}") + endif() add_test (NAME ${name} COMMAND ${name} -o ${PROJECT_BINARY_DIR}/test_outputs/junit-${name}.xml -r junit) endfunction (CORSIKA_ADD_TEST) diff --git a/Documentation/Examples/CMakeLists.txt b/Documentation/Examples/CMakeLists.txt index c677f3ab9a3dccd82235fee8d4690be4de697d17..3fa3a6b79e000e1bed4b222d137e329ed290fe32 100644 --- a/Documentation/Examples/CMakeLists.txt +++ b/Documentation/Examples/CMakeLists.txt @@ -1,30 +1,24 @@ -add_executable (helix_example helix_example.cc) -target_compile_options(helix_example PRIVATE -g) # do not skip asserts -target_link_libraries(helix_example CORSIKAgeometry CORSIKAunits) -install (TARGETS helix_example DESTINATION share/examples) CORSIKA_ADD_TEST (helix_example) +target_link_libraries (helix_example CORSIKAgeometry CORSIKAunits) +install (TARGETS helix_example DESTINATION share/examples) -add_executable (geometry_example geometry_example.cc) -target_compile_options(geometry_example PRIVATE -g) # do not skip asserts +CORSIKA_ADD_TEST (geometry_example) target_link_libraries (geometry_example CORSIKAgeometry CORSIKAunits) install (TARGETS geometry_example DESTINATION share/examples) -CORSIKA_ADD_TEST (geometry_example) -add_executable (logger_example logger_example.cc) -target_compile_options(logger_example PRIVATE -g) # do not skip asserts +CORSIKA_ADD_TEST (logger_example) target_link_libraries (logger_example CORSIKAunits CORSIKAlogging) install (TARGETS logger_example DESTINATION share/examples) -CORSIKA_ADD_TEST (logger_example) -add_executable (stack_example stack_example.cc) -target_compile_options(stack_example PRIVATE -g) # do not skip asserts +CORSIKA_ADD_TEST (stack_example) target_link_libraries (stack_example SuperStupidStack CORSIKAunits CORSIKAlogging) -CORSIKA_ADD_TEST (stack_example) -add_executable (cascade_example cascade_example.cc) -target_compile_options(cascade_example PRIVATE -g) # do not skip asserts -target_link_libraries (cascade_example SuperStupidStack CORSIKAunits +# address sanitizer is making this example too slow, so we only do "undefined" +CORSIKA_ADD_TEST (cascade_example SANITIZE "undefined") +target_link_libraries (cascade_example + SuperStupidStack + CORSIKAunits CORSIKAlogging CORSIKArandom ProcessSibyll @@ -42,11 +36,12 @@ target_link_libraries (cascade_example SuperStupidStack CORSIKAunits CORSIKAprocesssequence ) install (TARGETS cascade_example DESTINATION share/examples) -CORSIKA_ADD_TEST (cascade_example) -add_executable (boundary_example boundary_example.cc) -target_compile_options(boundary_example PRIVATE -g) # do not skip asserts -target_link_libraries (boundary_example SuperStupidStack CORSIKAunits CORSIKAlogging +CORSIKA_ADD_TEST (boundary_example) +target_link_libraries (boundary_example + SuperStupidStack + CORSIKAunits + CORSIKAlogging CORSIKArandom ProcessSibyll CORSIKAcascade @@ -60,12 +55,12 @@ target_link_libraries (boundary_example SuperStupidStack CORSIKAunits CORSIKAlog CORSIKAprocesssequence ) install (TARGETS boundary_example DESTINATION share/examples) -CORSIKA_ADD_TEST (boundary_example) if (Pythia8_FOUND) - add_executable (cascade_proton_example cascade_proton_example.cc) - target_compile_options(cascade_proton_example PRIVATE -g) # do not skip asserts - target_link_libraries (cascade_proton_example SuperStupidStack CORSIKAunits + CORSIKA_ADD_TEST (cascade_proton_example) + target_link_libraries (cascade_proton_example + SuperStupidStack + CORSIKAunits CORSIKAlogging CORSIKArandom ProcessSibyll @@ -84,14 +79,13 @@ if (Pythia8_FOUND) CORSIKAenvironment CORSIKAprocesssequence ) - install (TARGETS cascade_proton_example DESTINATION share/examples) - CORSIKA_ADD_TEST (cascade_proton_example) endif() -add_executable (vertical_EAS vertical_EAS.cc) -target_compile_options(vertical_EAS PRIVATE -g) # do not skip asserts -target_link_libraries (vertical_EAS SuperStupidStack CORSIKAunits +CORSIKA_ADD_TEST(vertical_EAS) +target_link_libraries (vertical_EAS + SuperStupidStack + CORSIKAunits CORSIKAlogging CORSIKArandom ProcessSibyll @@ -110,14 +104,11 @@ target_link_libraries (vertical_EAS SuperStupidStack CORSIKAunits CORSIKAprocesssequence ) install (TARGETS vertical_EAS DESTINATION share/examples) -# CORSIKA_ADD_TEST (vertical_EAS) not yet... -add_executable (staticsequence_example staticsequence_example.cc) -target_compile_options(staticsequence_example PRIVATE -g) # do not skip asserts +CORSIKA_ADD_TEST (staticsequence_example) target_link_libraries (staticsequence_example CORSIKAprocesssequence CORSIKAunits CORSIKAgeometry CORSIKAlogging) install (TARGETS staticsequence_example DESTINATION share/examples) -CORSIKA_ADD_TEST (staticsequence_example) diff --git a/Environment/CMakeLists.txt b/Environment/CMakeLists.txt index 13fd4f1e736d70a00b8380fdb6de6d906349b4a5..f32254e6ff526c4c992af99568e306f4d1e377f1 100644 --- a/Environment/CMakeLists.txt +++ b/Environment/CMakeLists.txt @@ -49,12 +49,10 @@ install ( # -------------------- # code unit testing -add_executable (testEnvironment testEnvironment.cc) - +CORSIKA_ADD_TEST(testEnvironment) target_link_libraries ( testEnvironment CORSIKAsetup CORSIKAenvironment CORSIKAthirdparty # for catch2 ) -CORSIKA_ADD_TEST(testGeometry) diff --git a/Framework/Cascade/CMakeLists.txt b/Framework/Cascade/CMakeLists.txt index cce178637582bb48a8b17d1017bc489802c192aa..e4890d87a6df375206cc2ebfad42b5abc42f4721 100644 --- a/Framework/Cascade/CMakeLists.txt +++ b/Framework/Cascade/CMakeLists.txt @@ -32,11 +32,7 @@ install ( # ---------------- # code unit testing -add_executable ( - testCascade - testCascade.cc - ) - +CORSIKA_ADD_TEST(testCascade) target_link_libraries ( testCascade # CORSIKAutls @@ -55,4 +51,3 @@ target_link_libraries ( CORSIKAunits CORSIKAthirdparty # for catch2 ) -CORSIKA_ADD_TEST(testCascade) diff --git a/Framework/Geometry/CMakeLists.txt b/Framework/Geometry/CMakeLists.txt index 510d8e3922f2c7c9a1bbd0578bea34f74641e500..6cda1a6fff3b6cfd069ec521f92dc7e2f77f66cc 100644 --- a/Framework/Geometry/CMakeLists.txt +++ b/Framework/Geometry/CMakeLists.txt @@ -67,20 +67,18 @@ install ( # -------------------- # code unit testing -add_executable (testGeometry testGeometry.cc) +CORSIKA_ADD_TEST(testGeometry) target_link_libraries ( testGeometry CORSIKAgeometry CORSIKAunits CORSIKAthirdparty # for catch2 ) -CORSIKA_ADD_TEST(testGeometry) -add_executable (testFourVector testFourVector.cc) +CORSIKA_ADD_TEST(testFourVector) target_link_libraries ( testFourVector CORSIKAgeometry CORSIKAunits CORSIKAthirdparty # for catch2 ) -CORSIKA_ADD_TEST(testFourVector) diff --git a/Framework/Logging/CMakeLists.txt b/Framework/Logging/CMakeLists.txt index 056aaad3549077dcf063243536c6d17b97a1e4a6..0926ad6576a74bb2585daba367461613e42f07c6 100644 --- a/Framework/Logging/CMakeLists.txt +++ b/Framework/Logging/CMakeLists.txt @@ -38,15 +38,11 @@ install ( # ---------------- # code unit testing -add_executable ( - testLogging - testLogging.cc - ) +CORSIKA_ADD_TEST (testLogging) target_link_libraries ( testLogging CORSIKAlogging CORSIKAthirdparty # for catch2 ) -CORSIKA_ADD_TEST (testLogging) diff --git a/Framework/Particles/CMakeLists.txt b/Framework/Particles/CMakeLists.txt index cde894b095905f226a8e3a781bcc9f3b0daeb896..48f1b76926ec72eb0b83ed18bde939142c1b3365 100644 --- a/Framework/Particles/CMakeLists.txt +++ b/Framework/Particles/CMakeLists.txt @@ -82,16 +82,14 @@ install ( # -------------------- # code unit testing -add_executable ( - testParticles - testParticles.cc - ${PROJECT_BINARY_DIR}/Framework/Particles/GeneratedParticleProperties.inc - ) - +CORSIKA_ADD_TEST(testParticles + SOURCES + testParticles.cc + ${PROJECT_BINARY_DIR}/Framework/Particles/GeneratedParticleProperties.inc +) target_link_libraries ( testParticles CORSIKAparticles CORSIKAunits CORSIKAthirdparty # for catch2 ) -CORSIKA_ADD_TEST(testParticles) diff --git a/Framework/ProcessSequence/CMakeLists.txt b/Framework/ProcessSequence/CMakeLists.txt index 33aad8236f6b2943d083fd95addcea1698700d43..c1a4c77830c559edd56dd0d7307eca12daa96ab8 100644 --- a/Framework/ProcessSequence/CMakeLists.txt +++ b/Framework/ProcessSequence/CMakeLists.txt @@ -45,11 +45,7 @@ target_link_libraries ( #-- -- -- -- -- -- -- -- #code unit testing -add_executable ( - testProcessSequence - testProcessSequence.cc - ) - +CORSIKA_ADD_TEST(testProcessSequence) target_link_libraries ( testProcessSequence CORSIKAsetup @@ -57,4 +53,3 @@ target_link_libraries ( CORSIKAprocesssequence CORSIKAthirdparty # for catch2 ) -CORSIKA_ADD_TEST(testProcessSequence) diff --git a/Framework/Random/CMakeLists.txt b/Framework/Random/CMakeLists.txt index bbbe8d32d484373f6ed62495893508c5996dd59f..b553d8c44e01cdc678a27d311d96645744a374dc 100644 --- a/Framework/Random/CMakeLists.txt +++ b/Framework/Random/CMakeLists.txt @@ -46,11 +46,9 @@ install ( # -------------------- # code unit testing -add_executable (testRandom testRandom.cc) - +CORSIKA_ADD_TEST(testRandom) target_link_libraries ( testRandom CORSIKArandom CORSIKAthirdparty # for catch2 ) -CORSIKA_ADD_TEST(testRandom) diff --git a/Framework/StackInterface/CMakeLists.txt b/Framework/StackInterface/CMakeLists.txt index fa0edbef35fe95ba01cd10381247380423d28a67..91b09a2ee22af91c289c4ae977d61e7738462872 100644 --- a/Framework/StackInterface/CMakeLists.txt +++ b/Framework/StackInterface/CMakeLists.txt @@ -34,14 +34,11 @@ install ( ) #code testing -add_executable (testStackInterface testStackInterface.cc) -target_link_libraries (testStackInterface CORSIKAstackinterface CORSIKAthirdparty) # for catch2 CORSIKA_ADD_TEST(testStackInterface) +target_link_libraries (testStackInterface CORSIKAstackinterface CORSIKAthirdparty) # for catch2 -add_executable (testSecondaryView testSecondaryView.cc) -target_link_libraries (testSecondaryView CORSIKAstackinterface CORSIKAthirdparty) # for catch2 CORSIKA_ADD_TEST(testSecondaryView) +target_link_libraries (testSecondaryView CORSIKAstackinterface CORSIKAthirdparty) # for catch2 -add_executable (testCombinedStack testCombinedStack.cc) -target_link_libraries (testCombinedStack CORSIKAstackinterface CORSIKAthirdparty) # for catch2 CORSIKA_ADD_TEST(testCombinedStack) +target_link_libraries (testCombinedStack CORSIKAstackinterface CORSIKAthirdparty) # for catch2 diff --git a/Framework/Units/CMakeLists.txt b/Framework/Units/CMakeLists.txt index 639c5cbd8e589f8d3e98623773776a93636a4828..226396ea49132616c57a64a92cb13ddf18783686 100644 --- a/Framework/Units/CMakeLists.txt +++ b/Framework/Units/CMakeLists.txt @@ -20,6 +20,5 @@ target_include_directories (CORSIKAunits install (FILES ${CORSIKAunits_HEADERS} DESTINATION include/${CORSIKAunits_NAMESPACE}) # code testing -add_executable (testUnits testUnits.cc) -target_link_libraries (testUnits CORSIKAunits CORSIKAthirdparty) # for catch2 CORSIKA_ADD_TEST(testUnits) +target_link_libraries (testUnits CORSIKAunits CORSIKAthirdparty) # for catch2 diff --git a/Framework/Utilities/CMakeLists.txt b/Framework/Utilities/CMakeLists.txt index 763c534f1c6df580d04211e0d29f87588758418a..5624ea4f024c35d23def2ca8544a17a6bc980810 100644 --- a/Framework/Utilities/CMakeLists.txt +++ b/Framework/Utilities/CMakeLists.txt @@ -72,20 +72,16 @@ install ( # -------------------- # code unit testing -add_executable (testCOMBoost testCOMBoost.cc) - +CORSIKA_ADD_TEST(testCOMBoost) target_link_libraries ( testCOMBoost CORSIKAutilities CORSIKAthirdparty # for catch2 ) -add_executable (testCorsikaFenv testCorsikaFenv.cc) - +CORSIKA_ADD_TEST(testCorsikaFenv) target_link_libraries ( testCorsikaFenv CORSIKAutilities CORSIKAthirdparty # for catch2 ) -CORSIKA_ADD_TEST(testCOMBoost) -add_test(testCorsikaFenv testCorsikaFenv) diff --git a/Processes/EnergyLoss/CMakeLists.txt b/Processes/EnergyLoss/CMakeLists.txt index 41eb2ececa1ba9baba44836c58151d8dfd5f6623..5333eaf4cc8ba39d59ecd67ea83ffcefd55687bd 100644 --- a/Processes/EnergyLoss/CMakeLists.txt +++ b/Processes/EnergyLoss/CMakeLists.txt @@ -52,8 +52,7 @@ install ( # -------------------- # code unit testing -#add_executable (testNullModel testNullModel.cc) - +#CORSIKA_ADD_TEST (testNullModel testNullModel.cc) #target_link_libraries ( # testNullModel ProcessNullModel # CORSIKAsetup @@ -61,5 +60,4 @@ install ( # CORSIKAunits # CORSIKAthirdparty # for catch2 # ) -# CORSIKA_ADD_TEST(testNullModel) diff --git a/Processes/HadronicElasticModel/CMakeLists.txt b/Processes/HadronicElasticModel/CMakeLists.txt index 60f0b7999d0820f6b1881b63a980c2f983ff2431..993aeba732e0dc20a224109299bf1259eb66f09f 100644 --- a/Processes/HadronicElasticModel/CMakeLists.txt +++ b/Processes/HadronicElasticModel/CMakeLists.txt @@ -51,14 +51,12 @@ install ( # -------------------- # code unit testing -#~ add_executable (ProcessHadronicElasticModel testProcessHadronicElasticModel.cc) - -#~ target_link_libraries ( - #~ testProcessHadronicElasticModel - #~ ProcessHadronicElasticModel - #~ CORSIKAsetup - #~ CORSIKAgeometry - #~ CORSIKAunits - #~ CORSIKAthirdparty # for catch2 - #~ ) -#~ CORSIKA_ADD_TEST(testNullModel) +# CORSIKA_ADD_TEST (testProcessHadronicElasticModel) +# target_link_libraries ( + # testProcessHadronicElasticModel + # ProcessHadronicElasticModel + # CORSIKAsetup + # CORSIKAgeometry + # CORSIKAunits + # CORSIKAthirdparty # for catch2 + # ) diff --git a/Processes/NullModel/CMakeLists.txt b/Processes/NullModel/CMakeLists.txt index c3355c77c93904d61fa61aab8d5a23fe9b1a5416..e84d6d9246833cd4e2e763cebd5ef238119a9bfa 100644 --- a/Processes/NullModel/CMakeLists.txt +++ b/Processes/NullModel/CMakeLists.txt @@ -50,8 +50,7 @@ install ( # -------------------- # code unit testing -add_executable (testNullModel testNullModel.cc) - +CORSIKA_ADD_TEST(testNullModel) target_link_libraries ( testNullModel ProcessNullModel @@ -60,4 +59,3 @@ target_link_libraries ( CORSIKAunits CORSIKAthirdparty # for catch2 ) -CORSIKA_ADD_TEST(testNullModel) diff --git a/Processes/ParticleCut/CMakeLists.txt b/Processes/ParticleCut/CMakeLists.txt index 48b539b47d273f0c1e359cb3f2d4f68cc07f1ea9..ffecd790978a1504bbb6c43e7648e273fcacbafa 100644 --- a/Processes/ParticleCut/CMakeLists.txt +++ b/Processes/ParticleCut/CMakeLists.txt @@ -48,10 +48,10 @@ install ( # -------------------- # code unit testing -add_executable (testParticleCut +CORSIKA_ADD_TEST(testParticleCut SOURCES testParticleCut.cc ${MODEL_HEADERS} - ) +) target_link_libraries ( testParticleCut @@ -64,4 +64,3 @@ target_link_libraries ( CORSIKAenvironment CORSIKAthirdparty # for catch2 ) -CORSIKA_ADD_TEST(testParticleCut) diff --git a/Processes/Pythia/CMakeLists.txt b/Processes/Pythia/CMakeLists.txt index adc953090c31505acf4fd4c6c85dd85435ca136c..ae6467108c5cb0b938ded042d770301d5da811d4 100644 --- a/Processes/Pythia/CMakeLists.txt +++ b/Processes/Pythia/CMakeLists.txt @@ -68,12 +68,12 @@ install ( # -------------------- # code unit testing -add_executable (testPythia + +CORSIKA_ADD_TEST(testPythia + SOURCES testPythia.cc ${MODEL_HEADERS} - ) - - +) target_link_libraries ( testPythia ProcessPythia @@ -85,4 +85,3 @@ target_link_libraries ( ${PYTHIA8_LIBRARY} ) -CORSIKA_ADD_TEST(testPythia) diff --git a/Processes/Sibyll/CMakeLists.txt b/Processes/Sibyll/CMakeLists.txt index 58b83f9b8ebccc6292752982ea26735944e536a2..46b19c5009867bcae6b2ea285585d261bed52b4f 100644 --- a/Processes/Sibyll/CMakeLists.txt +++ b/Processes/Sibyll/CMakeLists.txt @@ -100,10 +100,11 @@ install ( # -------------------- # code unit testing -add_executable (testSibyll +CORSIKA_ADD_TEST(testSibyll + SOURCES testSibyll.cc ${MODEL_HEADERS} - ) +) target_link_libraries ( testSibyll @@ -114,4 +115,3 @@ target_link_libraries ( CORSIKAunits CORSIKAthirdparty # for catch2 ) -CORSIKA_ADD_TEST(testSibyll) diff --git a/Processes/StackInspector/CMakeLists.txt b/Processes/StackInspector/CMakeLists.txt index f8297639672f215e7a34e2330bd8e8387454d185..cbf216ca9094463912ff36eade3293660aba967b 100644 --- a/Processes/StackInspector/CMakeLists.txt +++ b/Processes/StackInspector/CMakeLists.txt @@ -52,8 +52,7 @@ install ( # -------------------- # code unit testing -add_executable (testStackInspector testStackInspector.cc) - +CORSIKA_ADD_TEST(testStackInspector) target_link_libraries ( testStackInspector ProcessStackInspector @@ -61,4 +60,3 @@ target_link_libraries ( CORSIKAunits CORSIKAthirdparty # for catch2 ) -CORSIKA_ADD_TEST(testStackInspector) diff --git a/Processes/SwitchProcess/CMakeLists.txt b/Processes/SwitchProcess/CMakeLists.txt index feac9f360ced5356d90ecd87cc7d4ca51939e0f6..577fdf9ce2faaf6cb7edd286f07b996b4ecc29ac 100644 --- a/Processes/SwitchProcess/CMakeLists.txt +++ b/Processes/SwitchProcess/CMakeLists.txt @@ -38,8 +38,7 @@ install (FILES ${MODEL_HEADERS} DESTINATION include/${MODEL_NAMESPACE}) # -------------------- # code unit testing -add_executable (testSwitchProcess testSwitchProcess.cc) - +CORSIKA_ADD_TEST(testSwitchProcess) target_link_libraries ( testSwitchProcess ProcessSwitch @@ -47,4 +46,3 @@ target_link_libraries ( CORSIKAthirdparty # for catch2 ) -CORSIKA_ADD_TEST(testSwitchProcess) diff --git a/Processes/TrackWriter/CMakeLists.txt b/Processes/TrackWriter/CMakeLists.txt index 67b99083ff4f3de803bd585fb4136931268148fd..b1cad804b85baacad0958a9172f965247a0806dc 100644 --- a/Processes/TrackWriter/CMakeLists.txt +++ b/Processes/TrackWriter/CMakeLists.txt @@ -51,8 +51,7 @@ install ( # -------------------- # code unit testing -#add_executable (testNullModel testNullModel.cc) - +# CORSIKA_ADD_TEST(testNullModel) #target_link_libraries ( # testNullModel ProcessNullModel # CORSIKAsetup @@ -60,5 +59,4 @@ install ( # CORSIKAunits # CORSIKAthirdparty # for catch2 # ) -# CORSIKA_ADD_TEST(testNullModel) diff --git a/Processes/TrackingLine/CMakeLists.txt b/Processes/TrackingLine/CMakeLists.txt index c8b950532dd5e34b092f29d071604e9b8e4b75cf..24dcabc8b0c7d581baddbde0e817fa96ffe0a7c3 100644 --- a/Processes/TrackingLine/CMakeLists.txt +++ b/Processes/TrackingLine/CMakeLists.txt @@ -47,11 +47,9 @@ install (FILES ${MODEL_HEADERS} DESTINATION include/${MODEL_NAMESPACE}) # #-- -- -- -- -- -- -- -- -- -- # #code unit testing -add_executable (testTrackingLine testTrackingLine.cc) - +CORSIKA_ADD_TEST(testTrackingLine) target_link_libraries ( testTrackingLine ProcessTrackingLine CORSIKAthirdparty # for catch2 ) -CORSIKA_ADD_TEST(testTrackingLine) diff --git a/Processes/UrQMD/CMakeLists.txt b/Processes/UrQMD/CMakeLists.txt index 897492b2e808cd9c743a33bb8b4f66f5ee9a9d79..ca8cc4e01192afb56bceae368cbedeeb137f9684 100644 --- a/Processes/UrQMD/CMakeLists.txt +++ b/Processes/UrQMD/CMakeLists.txt @@ -83,11 +83,7 @@ install ( # -------------------- # code unit testing -add_executable (testUrQMD - testUrQMD.cc - ${MODEL_HEADERS} - ) - +CORSIKA_ADD_TEST(testUrQMD SOURCES testUrQMD.cc ${MODEL_HEADERS}) target_link_libraries ( testUrQMD ProcessUrQMD @@ -96,5 +92,4 @@ target_link_libraries ( CORSIKAgeometry CORSIKAunits CORSIKAthirdparty # for catch2 - ) -CORSIKA_ADD_TEST(testUrQMD) + ) \ No newline at end of file diff --git a/Stack/NuclearStackExtension/CMakeLists.txt b/Stack/NuclearStackExtension/CMakeLists.txt index 6032c0b90218790d6622a0474af371c62687b711..6a035375e3dc100af848c84aad484aff3f55fc6c 100644 --- a/Stack/NuclearStackExtension/CMakeLists.txt +++ b/Stack/NuclearStackExtension/CMakeLists.txt @@ -31,11 +31,7 @@ install ( # ---------------- # code unit testing -add_executable ( - testNuclearStackExtension - testNuclearStackExtension.cc - ) - +CORSIKA_ADD_TEST(testNuclearStackExtension) target_link_libraries ( testNuclearStackExtension SuperStupidStack @@ -45,4 +41,3 @@ target_link_libraries ( CORSIKAunits CORSIKAthirdparty # for catch2 ) -CORSIKA_ADD_TEST(testNuclearStackExtension) diff --git a/Stack/SuperStupidStack/CMakeLists.txt b/Stack/SuperStupidStack/CMakeLists.txt index d787f0d033ce0977a96c875412685c4dc1f1d38c..777e65a3d1352f1085b7b057003d01e32e9ba4c5 100644 --- a/Stack/SuperStupidStack/CMakeLists.txt +++ b/Stack/SuperStupidStack/CMakeLists.txt @@ -31,11 +31,7 @@ install ( # ---------------- # code unit testing -add_executable ( - testSuperStupidStack - testSuperStupidStack.cc - ) - +CORSIKA_ADD_TEST(testSuperStupidStack) target_link_libraries ( testSuperStupidStack CORSIKAgeometry @@ -43,4 +39,3 @@ target_link_libraries ( CORSIKAunits CORSIKAthirdparty # for catch2 ) -CORSIKA_ADD_TEST(testSuperStupidStack)