Skip to content

Commit 2f38f8d

Browse files
committed
Merge branch 'gcovi-json'
Implemented name-binning of gcov input files (fixes use of `new-gcovi` with GCC 8). Added support of `gcov --json-format` to `new-gcovi`, which makes the command usable with GCC 9 and newer.
2 parents 0fd315f + 7ef176c commit 2f38f8d

File tree

11 files changed

+557
-74
lines changed

11 files changed

+557
-74
lines changed

README.md

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
**uncov**, _v0.3_, _2016 – 2021_
22

3-
_This file last updated on 26 May, 2021_
3+
_This file last updated on 6 June, 2021_
44

55
1. [Description](#description)
66
2. [Supported Environment](#supported-environment)
@@ -80,26 +80,28 @@ Expected to work in Unix-like environments.
8080

8181
## Usage ##
8282

83-
GCC 8 and newer (json format of intermediate data isn't handled by `new-gcovi`):
83+
Using subcommand (should be faster and less problematic):
84+
85+
# drop coverage counters from previous run
86+
find . -name '*.gcda' -delete
87+
# << run tests here >>
88+
# collect coverage (--capture-worktree automatically makes stray commit if
89+
# worktree is dirty)
90+
uncov new-gcovi --exclude tests/ --exclude web/ --capture-worktree
91+
92+
Using a Python script:
8493

8594
# reset coverage counters from previous runs
8695
find . -name '*.gcda' -delete
87-
# < run tests here >
96+
# << run tests here >>
8897
# generage coverage for every object file found (change "." to build root)
8998
find . -name '*.o' -exec gcov -p {} +
90-
# generage and combine coverage reports (--capture-worktree automatically
91-
# makes stray commit if worktree is dirty)
99+
# collect coverage (--capture-worktree automatically makes stray commit if
100+
# worktree is dirty)
92101
uncov-gcov --root . --no-gcov --capture-worktree --exclude tests | uncov new
93102
# remove coverage reports
94103
find . -name '*.gcov' -delete
95104

96-
Earlier versions of GCC:
97-
98-
# drop coverage counters from previous run
99-
find . -name '*.gcda' -delete
100-
# < run tests at this point >
101-
uncov new-gcovi --exclude tests/ --exclude web/ --capture-worktree
102-
103105
### Example ###
104106

105107
The easiest way of checking out `uncov` is by using it on itself (assuming that

docs/uncov-gcov.1

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,19 @@
11
.\" Automatically generated by Pandoc 1.17.0.3
22
.\"
3-
.TH "uncov-gcov" "1" "June 05, 2021" "uncov v0.3" ""
3+
.TH "uncov-gcov" "1" "June 06, 2021" "uncov v0.3" ""
44
.hy
55
.SH NAME
66
.PP
77
uncov\-gcov is coverage information collector for C and C++ languages
88
that can be used with \f[B]uncov(1)\f[].
9+
.PP
10+
\f[B]NOTE:\f[] since uncov\-gcov isn\[aq]t the only way to collect C and
11+
C++ coverage for uncov anymore, its use is discouraged.
12+
It is provided in case it might work better in some contexts because of
13+
some unique options (like taking exclusion markers of LCOV into
14+
account).
15+
It might be a good idea to switch to using "uncov new\-gcovi"
16+
subcommand.
917
.SH SYNOPSIS
1018
.PP
1119
\f[B]uncov\-gcov\f[] \f[B]\-h|\-\-help\f[]

docs/uncov-gcov/01-name.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,9 @@ NAME
33

44
uncov-gcov is coverage information collector for C and C++ languages that can be
55
used with **uncov(1)**.
6+
7+
**NOTE:** since uncov-gcov isn't the only way to collect C and C++ coverage for
8+
uncov anymore, its use is discouraged. It is provided in case it might work
9+
better in some contexts because of some unique options (like taking exclusion
10+
markers of LCOV into account). It might be a good idea to switch to using
11+
"uncov new-gcovi" subcommand.

docs/uncov.1

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.\" Automatically generated by Pandoc 1.17.0.3
22
.\"
3-
.TH "uncov" "1" "May 26, 2021" "uncov v0.3" ""
3+
.TH "uncov" "1" "June 05, 2021" "uncov v0.3" ""
44
.hy
55
.SH NAME
66
.PP
@@ -375,9 +375,6 @@ when greater than zero \-\- line is covered and was hit that many times.
375375
.SS new\-gcovi
376376
.PP
377377
Generates coverage via \f[C]gcov\f[] and imports it.
378-
Doesn\[aq]t understand json version of intermediate format and is thus
379-
unusable for GCC older than GCC 7 and GCC 8 has a bug which prevents
380-
this command from working correctly.
381378
.PP
382379
\f[B]Usage: new\-gcovi [options...] [covoutroot]\f[]
383380
.PP

docs/uncov/06-subcommand-list.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -197,9 +197,7 @@ Integers have the following meaning:
197197
new-gcovi
198198
---------
199199

200-
Generates coverage via `gcov` and imports it. Doesn't understand json version
201-
of intermediate format and is thus unusable for GCC older than GCC 7 and GCC 8
202-
has a bug which prevents this command from working correctly.
200+
Generates coverage via `gcov` and imports it.
203201

204202
**Usage: new-gcovi [options...] [covoutroot]**
205203

0 commit comments

Comments
 (0)