xaizek / uncov (License: AGPLv3+) (since 2018-12-07)
Uncov(er) is a tool that collects and processes code coverage reports.
<root> / docs / uncov-gcov.1 (af863a7c284b866c550e40f543a06dd70e4bfcd2) (3,277B) (mode 100644) [raw]
.\" Automatically generated by Pandoc 1.17.0.3
.\"
.TH "uncov-gcov" "1" "September 23, 2017" "uncov v0.2" ""
.hy
.SH NAME
.PP
uncov\-gcov is coverage information collector for C and C++ languages to
be used with \f[B]uncov(1)\f[].
.SH SYNOPSIS
.PP
\f[B]uncov\-gcov\f[] \f[B]\-h|\-\-help\f[]
.PP
\f[B]uncov\-gcov\f[] \f[B]\-v|\-\-version\f[]
.PP
\f[B]uncov\-gcov\f[] \f[B][<options>...]\f[]
.SH OPTIONS
.SS \f[B]\-\-help, \-h\f[]
.PP
Displays short usage help.
.SS \f[B]\-\-version, \-v\f[]
.PP
Displays version information.
.SS \f[B]\-\-verbose\f[]
.PP
Print verbose messages.
.SS \f[B]\-\-dryrun\f[]
.PP
Run the script without printing report.
.SS \f[B]\-\-gcov\f[] [=gcov]
.PP
Set the location of gcov.
.SS \f[B]\-\-gcov\-options\f[] [=""]
.PP
Set the options given to gcov.
.SS \f[B]\-r\f[], \f[B]\-\-root\f[] [=.]
.PP
Set the root directory.
.SS \f[B]\-b\f[], \f[B]\-\-build\-root\f[] [={discovered}]
.PP
Set the directory from which gcov will be called; by default gcov is run
in the directory of the .o files; however the paths of the sources are
often relative to the directory from which the compiler was run and
these relative paths are saved in the .o file; when this happens, gcov
needs to run in the same directory as the compiler in order to find the
source files.
.SS \f[B]\-\-collect\-root\f[] [={value of \-\-root}]
.PP
Directory to look gcov files in.
.SS \f[B]\-e\f[], \f[B]\-\-exclude\f[] [=""]
.PP
Set exclude file or directory.
.SS \f[B]\-i\f[], \f[B]\-\-include\f[] [=""]
.PP
Set include file or directory.
.SS \f[B]\-E\f[], \f[B]\-\-exclude\-pattern\f[] [=""]
.PP
Set exclude file/directory pattern.
.SS \f[B]\-x\f[], \f[B]\-\-extension\f[]
[=.h,.hh,.hpp,.hxx,.c,.cc,.cpp,.cxx,.m,.mm]
.PP
Set extension of files to process.
.SS \f[B]\-n\f[], \f[B]\-\-no\-gcov\f[]
.PP
Do not run gcov.
.SS \f[B]\-\-encodings\f[] [=utf\-8,latin\-1]
.PP
Source encodings to try in order of preference.
.SS \f[B]\-\-dump\f[] <file>
.PP
Dump JSON payload to a file.
.SS \f[B]\-\-follow\-symlinks\f[]
.PP
Follow symlinks.
.SS \f[B]\-c\f[], \f[B]\-\-capture\-worktree\f[]
.PP
Make a dangling commit if working directory is dirty.
.SS \f[B]\-\-ref\-name\f[] [={discovered}]
.PP
Force custom ref name.
.SH USAGE
.PP
uncov\-gcov can be used to generate coverage, but it seems to not play
well with out\-of\-tree builds (some coverage is missing, this issue is
inherited from its origin), so the recommended way of recording coverage
information is as follows:
.IP
.nf
\f[C]
#\ reset\ coverage\ counters\ from\ previous\ runs
find\ .\ \-name\ \[aq]*.gcda\[aq]\ \-delete

#\ run\ tests\ here\ with\ something\ like\ `make\ check`

#\ generage\ coverage\ for\ every\ object\ file\ found\ (change\ "."\ to\ build\ root)
find\ .\ \-name\ \[aq]*.o\[aq]\ \-exec\ gcov\ \-p\ {}\ +

#\ generage\ and\ combine\ coverage\ reports\ (\-\-capture\-worktree\ automatically
#\ makes\ stray\ commit\ if\ repository\ is\ dirty)
uncov\-gcov\ \-\-root\ .\ \-\-no\-gcov\ \-\-capture\-worktree\ \-\-exclude\ tests\ |\ uncov\ new

#\ remove\ coverage\ reports
find\ .\ \-name\ \[aq]*.gcov\[aq]\ \-delete
\f[]
.fi
.PP
These commands can be put in a separate script or embedded directly into
build system.
.SH SEE ALSO
.PP
\f[B]uncov\f[](1), \f[B]uncov\-web\f[](1)
.SH AUTHORS
xaizek <xaizek@posteo.net>.
Hints

Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://code.reversed.top/user/xaizek/uncov

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@code.reversed.top/user/xaizek/uncov

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a pull request:
... clone the repository ...
... make some changes and some commits ...
git push origin master