Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
ogs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
Yuhao Liu
ogs
Commits
3410933d
Commit
3410933d
authored
13 years ago
by
Lars Bilke
Browse files
Options
Downloads
Patches
Plain Diff
Cobertura code coverage report generation with gcovr added.
parent
b27f8064
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
CodeCoverage.cmake
+23
-0
23 additions, 0 deletions
CodeCoverage.cmake
with
23 additions
and
0 deletions
CodeCoverage.cmake
+
23
−
0
View file @
3410933d
...
...
@@ -15,6 +15,7 @@
FIND_PROGRAM
(
GCOV_PATH gcov
)
FIND_PROGRAM
(
LCOV_PATH lcov
)
FIND_PROGRAM
(
GENHTML_PATH genhtml
)
FIND_PROGRAM
(
GCOVR_PATH gcovr
)
IF
(
NOT GCOV_PATH
)
MESSAGE
(
FATAL_ERROR
"gcov not found! Aborting..."
)
...
...
@@ -74,5 +75,27 @@ FUNCTION(SETUP_TARGET_FOR_COVERAGE _targetname _testrunner _outputname)
COMMAND ;
COMMENT
"Open ./
${
_outputname
}
/index.html in your browser to view the coverage report."
)
# This target produces a Jenkins readable Cobertura report
IF
(
GCOVR_PATH AND PYTHON_EXECUTABLE
)
ADD_CUSTOM_TARGET
(
${
_targetname
}
_cobertura
# Run tests
${
_testrunner
}
# Running gcovr
COMMAND
${
GCOVR_PATH
}
-x -r
${
CMAKE_SOURCE_DIR
}
-o
${
_outputname
}
.xml
WORKING_DIRECTORY
${
CMAKE_BINARY_DIR
}
COMMENT
"Running gcovr to produce Cobertura code coverage report."
)
# Show info where to find the report
ADD_CUSTOM_COMMAND
(
TARGET
${
_targetname
}
_cobertura POST_BUILD
COMMAND ;
COMMENT
"Cobertura code coverage report saved in
${
_outputname
}
.xml."
)
ENDIF
()
# GCOVR_PATH AND PythonInterp_FOUND
ENDFUNCTION
()
# SETUP_TARGET_FOR_COVERAGE
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