Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
ControlSystemAdapter-DoocsAdapter
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
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository 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
ChimeraTK Mirror
ControlSystemAdapter-DoocsAdapter
Commits
a9c83edb
Commit
a9c83edb
authored
8 years ago
by
Martin Killenberg
Browse files
Options
Downloads
Patches
Plain Diff
added make_coverage.sh.in and deprecated Makefile.coverage.in
parent
98dee98b
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
cmake/Makefile.coverage.in
+6
-0
6 additions, 0 deletions
cmake/Makefile.coverage.in
cmake/make_coverage.sh.in
+53
-0
53 additions, 0 deletions
cmake/make_coverage.sh.in
with
59 additions
and
0 deletions
cmake/Makefile.coverage.in
+
6
−
0
View file @
a9c83edb
...
...
@@ -2,6 +2,10 @@
#
# Additional make target for generating a code coverage report.
#
# ATTENTION: This file has bee deprecated in project-template and will no longer be maintained.
# DO NOT MODIFY THIS FILE IN THE PROJECT TEMPLATE!
# Use make_coverage.sh.in instead!
#
#######################################################################################################################
#######################################################################################################################
...
...
@@ -17,6 +21,7 @@
#######################################################################################################################
coverage
:
echo
ATTENTION: Using Makefile.coverage.in
in
your CMake project is deprecated. Please change to make_coverage.sh.in
rm
-f
`
find
.
-name
"*
\.
gcda"
`
make
test
lcov
--capture
--directory
.
--output-file
coverage_all.info
...
...
@@ -32,3 +37,4 @@ coverage:
#be empty!
lcov
--remove
coverage_incl_build.info
"@PROJECT_BINARY_DIR@/*"
-o
coverage.info
genhtml coverage.info
--output-directory
coverage_html
echo
ATTENTION: Using Makefile.coverage.in
in
your CMake project is deprecated. Please change to make_coverage.sh.in
This diff is collapsed.
Click to expand it.
cmake/make_coverage.sh.in
0 → 100755
+
53
−
0
View file @
a9c83edb
#!/bin/bash -e
#######################################################################################################################
#
# Shell script for generating a code coverage report.
#
# Parameter to be set inside the CMake project:
# EXCLUDE_FROM_COVERAGE (optional) Space separated list of directories in you source code which are excluded from the
# coverage report.
#
# CMAKE_SOURCE_DIR and PROJECT_BINARY_DIR are always automatically there.
#
#######################################################################################################################
#######################################################################################################################
#
# IMPORTANT NOTE:
#
# DO NOT MODIFY THIS FILE inside a project. Instead update the project-template repository and pull the change from
# there. Make sure to keep the file generic, since it will be used by other projects, too.
#
# If you have modified this file inside a project despite this warning, make sure to cherry-pick all your changes
# into the project-template repository immediately.
#
#######################################################################################################################
rm
-f
`
find
.
-name
"*
\.
gcda"
`
make
test
lcov
--capture
--directory
.
--output-file
coverage_all.info
#lcov capture also includes external stuff like glibc, boost etc.
#only extract the reports for this project
lcov
--extract
coverage_all.info
"@CMAKE_SOURCE_DIR@*"
-o
coverage_only_source_tree.info
#Some parts of the source code might be excluded. Set EXCLUDE_FROM_COVERAGE to contain
# a list of directories to be excluded from the coverage report.
# Don't worry if this is empty. It just means there is nothing to exclude (the normal case).
for
exclude_dir
in
@EXCLUDE_FROM_COVERAGE@
;
do
echo
lcov
--remove
coverage_only_source_tree.info
"@CMAKE_SOURCE_DIR@/
${
exclude_dir
}
*"
-o
tmp.info
lcov
--remove
coverage_only_source_tree.info
"@CMAKE_SOURCE_DIR@/
${
exclude_dir
}
*"
-o
tmp.info
mv
tmp.info coverage_only_source_tree.info
done
#Some projects install the library and its headers for testing in the build directory
#and compile tests and examples against it. This leads to double
#counting and untested lines in the coverage report. That's why we
#exclude the build directory from the coverage report (needed if the
#build directory is in the source tree).
#Attention: If you make an 'in sorce build' the coverage report will
#be empty!
lcov
--remove
coverage_only_source_tree.info
"@PROJECT_BINARY_DIR@/*"
-o
coverage.info
#finally generate the html page
genhtml coverage.info
--output-directory
coverage_html
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