diff --git a/#.gitlab-ci.yml# b/#.gitlab-ci.yml# deleted file mode 100644 index fb8f6a95b188b27e5e77d969a4c244a8d3788dde..0000000000000000000000000000000000000000 --- a/#.gitlab-ci.yml# +++ /dev/null @@ -1,37 +0,0 @@ -image: ubuntu:bionic - -variables: - GIT_SSL_NO_VERIFY: "1" - -before_script: - - apt-get update --yes - - apt-get install --yes cmake libboost-dev libeigen3-dev python3 gfortran - -build: - stage: build - tags: - - run1 - script: - - mkdir build - - cd build - - cmake .. - - cmake --build . - - ctest -V - -# code_quality: -# image: docker:stable -# variables: -# DOCKER_DRIVER: overlay2 -# allow_failure: true -# services: -# - docker:stable-dind -# script: -# - export SP_VERSION=$(echo "$CI_SERVER_VERSION" | sed 's/^\([0-9]*\)\.\([0-9]*\).*/\1-\2-stable/') -# - docker run -# --env SOURCE_CODE="$PWD" -# --volume "$PWD":/code -# --volume /var/run/docker.sock:/var/run/docker.sock -# "registry.gitlab.com/gitlab-org/security-products/codequality:$SP_VERSION" /code -# artifacts: -# reports: -# codequality: gl-code-quality-report.json diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c89e989d5612562bd824949cbd8171fe93845a0d..09936820642852b0f9b0949dd6abb40faa94a3bc 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -17,13 +17,15 @@ build: - cd build - cmake .. - cmake --build . - - ctest -V >& test.log + - ctest -j4 -V >& test.log - gzip -9 test.log artifacts: paths: - build/test.log.gz when: on_failure - + reports: + junit: + - build/test_outputs/junit*.xml pages: stage: build diff --git a/CMakeModules/CorsikaUtilities.cmake b/CMakeModules/CorsikaUtilities.cmake index 0ba70d8ff63f1e372fd8daae3e4f06cc96343a8e..c2a7df5c94be91d95fadd19703260736ac4eeaa6 100644 --- a/CMakeModules/CorsikaUtilities.cmake +++ b/CMakeModules/CorsikaUtilities.cmake @@ -78,3 +78,14 @@ macro (CORSIKA_ADD_FILES_ABSOLUTE varname) set ("${varname}" "${${varname}}" PARENT_SCOPE) endif() endmacro(CORSIKA_ADD_FILES_ABSOLUTE) + + + +# +# central macro to activate unit tests in cmake +# + +function (CORSIKA_ADD_TEST name) + file (MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/test_outputs/) + 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 47a7a495c8fb2713a37454a6432e96ac831a6ac2..00de097e7fe6bdeadb4262ab52d62224e91432af 100644 --- a/Documentation/Examples/CMakeLists.txt +++ b/Documentation/Examples/CMakeLists.txt @@ -2,24 +2,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) -add_test(helix_example helix_example) +CORSIKA_ADD_TEST (helix_example) add_executable (geometry_example geometry_example.cc) target_compile_options(geometry_example PRIVATE -g) # do not skip asserts target_link_libraries (geometry_example CORSIKAgeometry CORSIKAunits) install (TARGETS geometry_example DESTINATION share/examples) -add_test(geometry_example geometry_example) +CORSIKA_ADD_TEST (geometry_example) add_executable (logger_example logger_example.cc) target_compile_options(logger_example PRIVATE -g) # do not skip asserts target_link_libraries (logger_example CORSIKAunits CORSIKAlogging) install (TARGETS logger_example DESTINATION share/examples) -add_test(logger_example logger_example) +CORSIKA_ADD_TEST (logger_example) add_executable (stack_example stack_example.cc) target_compile_options(stack_example PRIVATE -g) # do not skip asserts target_link_libraries (stack_example SuperStupidStack CORSIKAunits CORSIKAlogging) -add_test(stack_example stack_example) +CORSIKA_ADD_TEST (stack_example) add_executable (cascade_example cascade_example.cc) target_compile_options(cascade_example PRIVATE -g) # do not skip asserts @@ -36,7 +36,7 @@ target_link_libraries (cascade_example SuperStupidStack CORSIKAunits CORSIKAlogg CORSIKAprocesssequence ) install (TARGETS cascade_example DESTINATION share/examples) -add_test(cascade_example cascade_example) +CORSIKA_ADD_TEST (cascade_example) add_executable (staticsequence_example staticsequence_example.cc) target_compile_options(staticsequence_example PRIVATE -g) # do not skip asserts @@ -46,4 +46,4 @@ target_link_libraries (staticsequence_example CORSIKAgeometry CORSIKAlogging) install (TARGETS staticsequence_example DESTINATION share/examples) -add_test(staticsequence_example staticsequence_example) +CORSIKA_ADD_TEST (staticsequence_example) diff --git a/Environment/CMakeLists.txt b/Environment/CMakeLists.txt index ca93c81cde5c8aec8df2f2ee3f10df371828b108..c4083f6f391babff17c107475b287eef9fbac812 100644 --- a/Environment/CMakeLists.txt +++ b/Environment/CMakeLists.txt @@ -48,6 +48,4 @@ target_link_libraries ( CORSIKAenvironment CORSIKAthirdparty # for catch2 ) - -add_test (NAME testGeometry COMMAND testGeometry) - +CORSIKA_ADD_TEST(testGeometry) diff --git a/Framework/Cascade/CMakeLists.txt b/Framework/Cascade/CMakeLists.txt index 8b832d21bb9fe0731d6a6294dc6b234e15fddac4..3e51de61808e63bce24247d1c43f2a05137dbc18 100644 --- a/Framework/Cascade/CMakeLists.txt +++ b/Framework/Cascade/CMakeLists.txt @@ -59,8 +59,4 @@ target_link_libraries ( CORSIKAunits CORSIKAthirdparty # for catch2 ) - -add_test ( - NAME testCascade - COMMAND testCascade - ) +CORSIKA_ADD_TEST(testStackInterface) diff --git a/Framework/Geometry/CMakeLists.txt b/Framework/Geometry/CMakeLists.txt index 3e2a8e1d4298af618835e80a9f1f1751704bbe18..4d708ff109e6d259a352e82536cece0f0bc4c53a 100644 --- a/Framework/Geometry/CMakeLists.txt +++ b/Framework/Geometry/CMakeLists.txt @@ -69,5 +69,4 @@ target_link_libraries ( CORSIKAthirdparty # for catch2 ) -add_test (NAME testGeometry COMMAND testGeometry) - +CORSIKA_ADD_TEST(testGeometry) diff --git a/Framework/Logging/CMakeLists.txt b/Framework/Logging/CMakeLists.txt index d7af35a8fb5f5fb7baa743262ed9491392cc7816..f8b1503537ae0538dccc98b153dbe88f1da260c7 100644 --- a/Framework/Logging/CMakeLists.txt +++ b/Framework/Logging/CMakeLists.txt @@ -47,9 +47,5 @@ target_link_libraries ( CORSIKAlogging CORSIKAthirdparty # for catch2 ) - -add_test ( - NAME testLogging - COMMAND testLogging - ) +CORSIKA_ADD_TEST (testLogging) diff --git a/Framework/Particles/CMakeLists.txt b/Framework/Particles/CMakeLists.txt index 3301139d597d1bc513e8b226db4708ca4c20f6ed..7798d2226c7fd70a48fa452975cceb27eb71da35 100644 --- a/Framework/Particles/CMakeLists.txt +++ b/Framework/Particles/CMakeLists.txt @@ -92,11 +92,4 @@ target_link_libraries ( CORSIKAunits CORSIKAthirdparty # for catch2 ) - -add_test ( - NAME - testParticles - COMMAND - testParticles - ) - +CORSIKA_ADD_TEST(testParticles) diff --git a/Framework/ProcessSequence/CMakeLists.txt b/Framework/ProcessSequence/CMakeLists.txt index 6c3e5ff8cc26e571955b937920dc086fd925869c..d45d28d6c208ef80302130bbe3e2e1c837b1dfcf 100644 --- a/Framework/ProcessSequence/CMakeLists.txt +++ b/Framework/ProcessSequence/CMakeLists.txt @@ -48,8 +48,4 @@ target_link_libraries ( CORSIKAprocesssequence CORSIKAthirdparty # for catch2 ) - -add_test ( - NAME testProcessSequence - COMMAND testProcessSequence - ) +CORSIKA_ADD_TEST(testProcessSequence) diff --git a/Framework/Random/CMakeLists.txt b/Framework/Random/CMakeLists.txt index 230f84f67f4ed6eb02652c5cb10853955f7de776..3607b585a62dcc418c986852428fc8fa8b518325 100644 --- a/Framework/Random/CMakeLists.txt +++ b/Framework/Random/CMakeLists.txt @@ -45,6 +45,4 @@ target_link_libraries ( CORSIKArandom CORSIKAthirdparty # for catch2 ) - -add_test (NAME testRandom COMMAND testRandom) - +CORSIKA_ADD_TEST(testRandom) diff --git a/Framework/StackInterface/CMakeLists.txt b/Framework/StackInterface/CMakeLists.txt index 42c52ceab9c30014de606890a37ae596538f4e1c..c6106121bfbdb3e1f277c387f767938cd2e0f1af 100644 --- a/Framework/StackInterface/CMakeLists.txt +++ b/Framework/StackInterface/CMakeLists.txt @@ -33,5 +33,5 @@ install ( #code testing add_executable (testStackInterface testStackInterface.cc) -add_test(NAME testStackInterface COMMAND testStackInterface) target_link_libraries (testStackInterface CORSIKAstackinterface CORSIKAthirdparty) # for catch2 +CORSIKA_ADD_TEST(testStackInterface) diff --git a/Framework/Units/CMakeLists.txt b/Framework/Units/CMakeLists.txt index 7948859e264449cb29bda5c3b1f141a86dbd2d65..639c5cbd8e589f8d3e98623773776a93636a4828 100644 --- a/Framework/Units/CMakeLists.txt +++ b/Framework/Units/CMakeLists.txt @@ -22,5 +22,4 @@ install (FILES ${CORSIKAunits_HEADERS} DESTINATION include/${CORSIKAunits_NAMESP # code testing add_executable (testUnits testUnits.cc) target_link_libraries (testUnits CORSIKAunits CORSIKAthirdparty) # for catch2 -add_test(NAME testUnits COMMAND testUnits) - +CORSIKA_ADD_TEST(testUnits) diff --git a/Framework/Utilities/CMakeLists.txt b/Framework/Utilities/CMakeLists.txt index 5ba7827be04ef4320da6374a5b52f0fbce79be13..5b21e9270e1f50e28323d0434580e29b3616b77a 100644 --- a/Framework/Utilities/CMakeLists.txt +++ b/Framework/Utilities/CMakeLists.txt @@ -58,6 +58,5 @@ target_link_libraries ( CORSIKAutilities CORSIKAthirdparty # for catch2 ) - -add_test (NAME testCOMBoost COMMAND testCOMBoost) +CORSIKA_ADD_TEST(testCOMBoost) diff --git a/Processes/NullModel/CMakeLists.txt b/Processes/NullModel/CMakeLists.txt index 300e3b571c581dce68f4983537a3ac128fcdf009..c3355c77c93904d61fa61aab8d5a23fe9b1a5416 100644 --- a/Processes/NullModel/CMakeLists.txt +++ b/Processes/NullModel/CMakeLists.txt @@ -60,6 +60,4 @@ target_link_libraries ( CORSIKAunits CORSIKAthirdparty # for catch2 ) - -add_test (NAME testNullModel COMMAND testNullModel) - +CORSIKA_ADD_TEST(testNullModel) diff --git a/Processes/Sibyll/CMakeLists.txt b/Processes/Sibyll/CMakeLists.txt index b1635360e2125e3b5fa8da64bb82804585cf34a6..ab8f9b3e094a42b00a63899442774d6b42c1b1f7 100644 --- a/Processes/Sibyll/CMakeLists.txt +++ b/Processes/Sibyll/CMakeLists.txt @@ -102,6 +102,4 @@ target_link_libraries ( CORSIKAunits CORSIKAthirdparty # for catch2 ) - -add_test (NAME testSibyll COMMAND testSibyll) - +CORSIKA_ADD_TEST(testSibyll) diff --git a/Processes/StackInspector/CMakeLists.txt b/Processes/StackInspector/CMakeLists.txt index f87cc1374c6161e98383a7e755a70190d62220e4..9711c42273ecbe5b5d1243053df87b7ca70db41d 100644 --- a/Processes/StackInspector/CMakeLists.txt +++ b/Processes/StackInspector/CMakeLists.txt @@ -60,6 +60,4 @@ target_link_libraries ( CORSIKAunits CORSIKAthirdparty # for catch2 ) - -add_test (NAME testStackInspector COMMAND testStackInspector) - +CORSIKA_ADD_TEST(testStackInspector) diff --git a/Processes/TrackWriter/CMakeLists.txt b/Processes/TrackWriter/CMakeLists.txt index e9c73d68b7f0f072e07c0e007b0dcd993adbf0ca..67b99083ff4f3de803bd585fb4136931268148fd 100644 --- a/Processes/TrackWriter/CMakeLists.txt +++ b/Processes/TrackWriter/CMakeLists.txt @@ -60,6 +60,5 @@ install ( # CORSIKAunits # CORSIKAthirdparty # for catch2 # ) - -#add_test (NAME testNullModel COMMAND testNullModel) +# CORSIKA_ADD_TEST(testNullModel) diff --git a/Processes/TrackingLine/CMakeLists.txt b/Processes/TrackingLine/CMakeLists.txt index b68564bfa284cce6048c88532e13b6f796cb6b9d..ce19ed677e8770abc571b638c8f7fa0e62b8c4ef 100644 --- a/Processes/TrackingLine/CMakeLists.txt +++ b/Processes/TrackingLine/CMakeLists.txt @@ -37,5 +37,4 @@ target_link_libraries ( CORSIKAgeometry CORSIKAthirdparty # for catch2 ) - -add_test (NAME testTrackingLine COMMAND testTrackingLine) +CORSIKA_ADD_TEST(testTrackingLine) diff --git a/Stack/SuperStupidStack/CMakeLists.txt b/Stack/SuperStupidStack/CMakeLists.txt index b9634f1d1bc523089dd4e90cb7caeaefe024480c..de96527d4a0fb757ac3e79b61ef4ff7481981fa1 100644 --- a/Stack/SuperStupidStack/CMakeLists.txt +++ b/Stack/SuperStupidStack/CMakeLists.txt @@ -44,8 +44,4 @@ target_link_libraries ( CORSIKAunits CORSIKAthirdparty # for catch2 ) - -add_test ( - NAME testSuperStupidStack - COMMAND testSuperStupidStack - ) +CORSIKA_ADD_TEST(testSuperStupidStack)