Kcov - code coverage
Kcov is a code coverage tester based on bcov by Thomas Neumann. It allows collecting code coverage information from executables without special command-line arguments, and continuosly produces output from long-running applications. If you use and like kcov, feel free to make a small donation:
Using kcov is as simple as
$ kcov /path/to/outdir executable [args for the executable]
So what are the similarities and differences when comparing kcov with bcov? First the similarities:
- Both generate lcov-style HTML output
- Both use DWARF debugging information to do coverage analysis on binaries compiled without special options
- Both store data incrementally, so that you can re-run your program with different arguments to build on the coverage collection
- Both are based on the same source code - that of bcov
The differences are:
- kcov collects coverage information and generates HTML output in a single step, whereas bcov first collects data and then generates HTML on the output
- kcov generates an updated web page every second, so long-running programs can be watched "live"
- kcov allows output to be sorted, either by coverage percentage or filename
- kcov allows specifying paths to include and exclude in the coverage, thereby limiting noise from system header files etc
- kcov allows multiple program coverage to be kept in a single HTML output directory, and will automatically add more programs as they are run
- bcov is written in C++, kcov in C
You can see some example kcov coverage output for C64-network.org and kcov itself here. Source code for Kcov is available at github and more information on the implementation can be found in this blog post. A screenshot from the report:
Download
The latest version is available here:
kcov-8.tar.gz
Author: Simon Kagstrom