IAP GITLAB
Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
corsika
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
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
Air Shower Physics
corsika
Commits
9b56461a
Commit
9b56461a
authored
3 years ago
by
ralfulrich
Browse files
Options
Downloads
Patches
Plain Diff
lcov/gcov fix
parent
c9788278
No related branches found
No related tags found
1 merge request
!371
Additional outputs ported to new architecture
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
CMakeLists.txt
+18
-5
18 additions, 5 deletions
CMakeLists.txt
with
18 additions
and
5 deletions
CMakeLists.txt
+
18
−
5
View file @
9b56461a
...
@@ -138,19 +138,32 @@ if (CMAKE_BUILD_TYPE STREQUAL Coverage)
...
@@ -138,19 +138,32 @@ if (CMAKE_BUILD_TYPE STREQUAL Coverage)
# compile coverage under -O0 to avoid any optimization, function elimation etc.
# compile coverage under -O0 to avoid any optimization, function elimation etc.
add_compile_options
(
"-O0"
)
add_compile_options
(
"-O0"
)
# search for local lcov
find_program
(
c8_lcov_bin lcov
)
if
(
NOT c8_lcov_bin
)
set
(
c8_lcov_bin
"
${
PROJECT_SOURCE_DIR
}
/externals/lcov/bin/lcov"
)
message
(
"use C8 version of lcov
${
c8_lcov_bin
}
"
)
endif
()
# search for local genhtml
find_program
(
c8_genhtml_bin genhtml
)
if
(
NOT c8_genhtml_bin
)
set
(
c8_genhtml_bin
"
${
PROJECT_SOURCE_DIR
}
/externals/lcov/bin/genhtml"
)
message
(
"use C8 version of genhtml
${
c8_genhtml_bin
}
"
)
endif
()
set
(
GCOV gcov CACHE STRING
"gcov executable"
FORCE
)
set
(
GCOV gcov CACHE STRING
"gcov executable"
FORCE
)
set
(
LCOV_BIN_DIR
"
${
PROJECT_SOURCE_DIR
}
/externals/lcov/bin"
)
# collect coverage data
# collect coverage data
add_custom_command
(
add_custom_command
(
OUTPUT raw-coverage.info
OUTPUT raw-coverage.info
COMMAND
${
CMAKE_COMMAND
}
-E echo
"Note: you need to run ctest at least once to generate the coverage data"
COMMAND
${
CMAKE_COMMAND
}
-E echo
"Note: you need to run ctest at least once to generate the coverage data"
COMMAND
${
LCOV_BIN_DIR
}
/lcov
--gcov-tool=
${
GCOV
}
--directory . --capture --output-file raw-coverage.info
COMMAND
${
c8_lcov_bin
}
--gcov-tool=
${
GCOV
}
--directory . --capture --output-file raw-coverage.info
)
)
# remove uninteresting entries
# remove uninteresting entries
add_custom_command
(
add_custom_command
(
OUTPUT coverage.info
OUTPUT coverage.info
COMMAND
${
LCOV_BIN_DIR
}
/lcov
-q --remove raw-coverage.info
"*/usr/*"
"/usr/*"
--output-file coverage2.info
COMMAND
${
c8_lcov_bin
}
-q --remove raw-coverage.info
"*/usr/*"
"/usr/*"
--output-file coverage2.info
COMMAND
${
LCOV_BIN_DIR
}
/lcov
--remove coverage2.info
COMMAND
${
c8_lcov_bin
}
--remove coverage2.info
"*/externals/*"
"*/tests/*"
"*/sibyll2.3d.cpp"
"*/.conan/*"
"*/externals/*"
"*/tests/*"
"*/sibyll2.3d.cpp"
"*/.conan/*"
"*/include/Pythia8/*"
"*/install/*"
"
${
CMAKE_SOURCE_DIR
}
/modules/*"
"*/include/Pythia8/*"
"*/install/*"
"
${
CMAKE_SOURCE_DIR
}
/modules/*"
"
${
CMAKE_BINARY_DIR
}
/modules/*"
"
${
CMAKE_BINARY_DIR
}
/modules/*"
...
@@ -161,7 +174,7 @@ if (CMAKE_BUILD_TYPE STREQUAL Coverage)
...
@@ -161,7 +174,7 @@ if (CMAKE_BUILD_TYPE STREQUAL Coverage)
# generate html report
# generate html report
add_custom_command
(
add_custom_command
(
OUTPUT coverage-report
OUTPUT coverage-report
COMMAND
${
LCOV_BIN_DIR
}
/
genhtml --demangle-cpp coverage.info -o coverage-report
COMMAND
${
c8_
genhtml
_bin
}
--demangle-cpp coverage.info -o coverage-report
DEPENDS coverage.info
DEPENDS coverage.info
)
)
add_custom_target
(
coverage DEPENDS coverage-report
)
add_custom_target
(
coverage DEPENDS coverage-report
)
...
...
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