Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
80e04f3e
Commit
80e04f3e
authored
Mar 01, 2021
by
Juergen Kosel
Committed by
Evan Read
Mar 01, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update test_coverage_visualization.md
Insert missing new lines to satisfy markdown lint checker.
parent
6e2582fe
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
0 deletions
+29
-0
doc/user/project/merge_requests/test_coverage_visualization.md
...ser/project/merge_requests/test_coverage_visualization.md
+29
-0
No files found.
doc/user/project/merge_requests/test_coverage_visualization.md
View file @
80e04f3e
...
...
@@ -219,3 +219,32 @@ run tests:
reports
:
cobertura
:
coverage.xml
```
### C/C++ example
The following
[
`gitlab-ci.yml`
](
../../../ci/yaml/README.md
)
example for C/C++ with
`gcc`
or
`g++`
as the compiler uses
[
`gcovr`
](
https://gcovr.com/en/stable/
)
to generate the coverage
output file in Cobertura XML format.
This example assumes:
-
That the
`Makefile`
is created by
`cmake`
in the
`build`
directory,
within another job in a previous stage.
(If you use
`automake`
to generate the
`Makefile`
,
then you need to call
`make check`
instead of
`make test`
.)
-
`cmake`
(or
`automake`
) has set the compiler option
`--coverage`
.
```
yaml
run tests
:
stage
:
test
script
:
-
cd build
-
make test
-
gcovr --xml-pretty --exclude-unreachable-branches --print-summary -o coverage.xml --root ${CI_PROJECT_DIR}
coverage
:
/^\s*lines:\s*\d+.\d+\%/
artifacts
:
name
:
${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}-${CI_COMMIT_SHA}
expire_in
:
2 days
reports
:
cobertura
:
build/coverage.xml
```
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment