IAP GITLAB

Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • AirShowerPhysics/corsika
  • rulrich/corsika
  • AAAlvesJr/corsika
  • Andre/corsika
  • arrabito/corsika
  • Nikos/corsika
  • olheiser73/corsika
  • AirShowerPhysics/papers/corsika
  • pranav/corsika
9 results
Show changes
Commits on Source (2)
......@@ -10,22 +10,27 @@ build:
script:
- mkdir build
- cd build
- cmake ..
- cmake .. -DCOVERAGE=ON
- cmake --build . -- -j 4
- ctest -j4 -V >& test.log
- ../Tools/coverage.sh
after_script:
- cd build
- ls
- gzip -v -9 -S .gz test.log
- tar cjf coverage-report.tar.bz2 coverage-report
- pwd
artifacts:
expire_in: 1 week
paths:
- build/test.log.gz
when: on_failure
reports:
junit:
- build/test_outputs/junit*.xml
reports:
junit:
- build/test_outputs/junit*.xml
when: on_success
paths:
- build/coverage-report.tar.bz2
pages:
stage: build
......
......@@ -22,12 +22,17 @@ set (CMAKE_CXX_EXTENSIONS OFF)
enable_testing ()
set (CTEST_OUTPUT_ON_FAILURE 1)
option(COVERAGE "Generate coverage data" OFF)
if(COVERAGE)
set(CMAKE_BUILD_TYPE "Debug")
endif()
# Set a default build type if none was specified
set(default_build_type "Release")
if(EXISTS "${CMAKE_SOURCE_DIR}/.git")
set(default_build_type "Debug")
endif()
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "Setting build type to '${default_build_type}' as no other was specified.")
set(CMAKE_BUILD_TYPE "${default_build_type}" CACHE
......@@ -37,11 +42,17 @@ if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
"Debug" "Release" "MinSizeRel" "RelWithDebInfo")
endif(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
# enable warnings and disallow non-standard language
set(CMAKE_CXX_FLAGS "-Wall -pedantic -Wextra -Wno-ignored-qualifiers")
set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g")
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -g") # -O2 would not trade speed for size, neither O2/3 use fast-math
set(CMAKE_Fortran_FLAGS "-std=legacy")
if(COVERAGE)
set(CMAKE_CXX_FLAGS "--coverage")
set(CMAKE_EXE_LINKER_FLAGS "--coverage")
set(CMAKE_SHARED_LINKER_FLAGS "--coverage")
endif()
# clang produces a lot of unecessary warnings without this:
add_compile_options("$<$<OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>>:-Wno-nonportable-include-path>")
......@@ -52,18 +63,6 @@ if (WITH_COAST)
add_compile_options("-fPIC")
endif()
# unit testing coverage, does not work yet
#include (CodeCoverage)
##set(COVERAGE_LCOV_EXCLUDES 'Documentation/*')
##setup_target_for_coverage(${PROJECT_NAME}_coverage ${PROJECT_TEST_NAME} coverage)
#SETUP_TARGET_FOR_COVERAGE_GCOVR_HTML (
# NAME corsika_coverage
# EXECUTABLE ctest
# #-j ${PROCESSOR_COUNT}
# # DEPENDENCIES corsika
# )
#add_custom_target (corsika_pre_build)
#add_custom_command (TARGET corsika_pre_build PRE_BUILD COMMAND "${PROJECT_SOURCE_DIR}/pre_compile.py")
......
#!/bin/sh
# must be executed in project root folder
if [ -z $GCOV ]; then
GCOV=gcov
fi
LCOV_VERSION="1.13"
LCOV_DIR="lcov-${LCOV_VERSION}"
if [ ! -e $LCOV_DIR ]; then
wget -O - https://github.com/linux-test-project/lcov/releases/download/v${LCOV_VERSION}/lcov-${LCOV_VERSION}.tar.gz | tar zxf -
fi
# LCOV="$LCOV_EXE --gcov-tool=${GCOV} --rc lcov_branch_coverage=1"
LCOV="${LCOV_DIR}/bin/lcov --gcov-tool=${GCOV}" # no branch coverage
# collect raw data
$LCOV --base-directory `pwd` \
--directory `pwd` \
--capture --output-file coverage.info
# remove uninteresting entries
$LCOV --extract coverage.info "*/corsika/*" --output-file coverage.info
# if [ $CI ]; then
# # upload if on CI
# curl -s https://codecov.io/bash | bash -s - -f coverage.info -X gcov -x $GCOV
# else
# # otherwise just print
# $LCOV_DIR/bin/genhtml coverage.info -o coverage-report
# fi
$LCOV_DIR/bin/genhtml coverage.info -o coverage-report