File | Mode | Size |
---|---|---|
data/ | 040000 | |
docs/ | 040000 | |
doxygen/ | 040000 | |
scripts/ | 040000 | |
src/ | 040000 | |
tests/ | 040000 | |
web/ | 040000 | |
.gitignore | 100644 | 250B |
COPYING | 100644 | 34KiB |
INSTALL.md | 100644 | 2,037B |
Makefile | 100644 | 8,384B |
README.md | 100644 | 6,561B |
TODO.md | 100644 | 9,386B |
config.h.in | 100644 | 87B |
uncov-gcov | 100755 | 22KiB |
uncov, v0.5, 2016 – 2024
This file last updated on 20 January, 2024
uncov
is a tool that collects and processes coverage reports.
By storing history of coverage reports it allows one to view how code coverage changes over time, compare changes that happened and view current state of the coverage.
The tool is deeply integrated with git repository of processed projects and thus avoids generation of static reports. Data is bound to repository information, but can be freely shared by several copies of the same repository (builds referring to unavailable git objects just won't be accessible).
Provided command-line interface should be familiar to most of git users and helps to avoid switching to a browser to verify code coverage.
It's also possible to display coverage information in a browser, say, on a CI server. This makes uncov something like self-hosted coveralls.io analogue (but note that Web-interface is secondary in this case and isn't feature complete).
Storage management tool itself is language independent and is relying on complementary tools to fetch and transform coverage data from language specific coverage harness.
Importer of coverage for C and C++ languages that collects data from gcov
is
provided.
Support for other languages can be added by converting existing coverage tools
or even using them as is. The new-json
subcommand accepts JSON that's used by
coveralls.io API, all what's needed is to extract this JSON and
pipe it to uncov new-json
(some tools might already have a command-line option
like --dump
, others could be extended by adding it).
Overall structure and basic elements are expected to remain in place, however they aren't finalized and changes for the sake of improvement are possible. Databases will be migrated if schema changes, so previously collected data won't be lost.
Expected to work in Unix-like environments.
uncov-gcov
instead of a subcommand.apt install -y make clang zlib1g-dev libsqlite3-dev libboost1.74-all-dev libsource-highlight-dev libgit2-dev
# optionally, if you want to build Web-UI
apt install -y libcxxtools-dev libtntnet-dev`
# optionally, if you intent to edit docs/*/*.md
apt install -y pandoc
Using subcommand (should be faster and less problematic):
# drop coverage counters from previous run
find . -name '*.gcda' -delete
# << run tests here >>
# collect coverage (--capture-worktree automatically makes stray commit if
# worktree is dirty)
uncov new-gcovi --exclude tests/ --exclude web/ --capture-worktree
Using deprecated Python script:
# reset coverage counters from previous runs
find . -name '*.gcda' -delete
# << run tests here >>
# generage coverage for every object file found (change "." to build root)
find . -name '*.o' -exec gcov -p {} +
# collect coverage (--capture-worktree automatically makes stray commit if
# worktree is dirty)
uncov-gcov --root . --no-gcov --capture-worktree --exclude tests | uncov new
# remove coverage reports
find . -name '*.gcov' -delete
The easiest way of checking out uncov
is by using it on itself (assuming that
you have just built it or just happen to have all the necessary development
dependencies).
In root of the project run make self-coverage
and then do
release/uncov build
to see something similar to:
release/uncov dirs
shows coverage per directory:
release/uncov changed
shows files which have their coverage changed:
release/uncov show src/SubCommand.cpp
shows annotated src/SubCommand.cpp
file:
When most of a file is covered, one probably wants to see just what's not yet
covered, this can be done with release/uncov missed
command:
Not everything can be demonstrated by self-coverage example above, so here are
some other interesting things. List of latest builds (uncov builds
):
Results of comparison (uncov diff
):
Annotated source code in Web-UI:
Annotated diff in Web-UI:
Deployed Web-interface can be seen here.
uncov-gcov
is based on cpp-coveralls.Version 3 of the GNU Affero General Public License.