IAP GITLAB
Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
corsika
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Antonio Augusto Alves Junior
corsika
Commits
3663f5e3
Commit
3663f5e3
authored
5 years ago
by
Hans Dembinski
Browse files
Options
Downloads
Patches
Plain Diff
init
parent
dd38818a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CMakeLists.txt
+12
-13
12 additions, 13 deletions
CMakeLists.txt
Tools/coverage.sh
+32
-0
32 additions, 0 deletions
Tools/coverage.sh
with
44 additions
and
13 deletions
CMakeLists.txt
+
12
−
13
View file @
3663f5e3
...
...
@@ -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")
...
...
This diff is collapsed.
Click to expand it.
Tools/coverage.sh
0 → 100755
+
32
−
0
View file @
3663f5e3
#!/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
echo
"Coverage report on CI currently disabled"
# 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
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment