• Stars
    star
    686
  • Rank 65,892 (Top 2 %)
  • Language
    C++
  • License
    GNU General Publi...
  • Created about 14 years ago
  • Updated 6 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Code coverage tool for compiled programs, Python and Bash which uses debugging information to collect and report data without special compilation options

Coveralls coverage status Codecov coverage status Coverity Scan Build Status Docker Pulls

PayPal Donate Github All Releases

kcov

Kcov is a FreeBSD/Linux/OSX code coverage tester for compiled languages, Python and Bash. Kcov was originally a fork of Bcov, but has since evolved to support a large feature set in addition to that of Bcov.

Kcov, like Bcov, uses DWARF debugging information for compiled programs to make it possible to collect coverage information without special compiler switches.

For a video introduction, look at this presentation from SwedenCPP

Installing

Refer to the INSTALL file for build instructions, or use our official Docker images:

Note:

Tags v31-v33 are re-tags of ragnaroek/kcov which were not automated builds.

Tags v34-v35 are non automated builds using the Dockerfile in master with 1 minor modification.

Tag v36 is a non automated build using the Dockerfile in master.

How to use it

Basic usage is straight-forward:

kcov /path/to/outdir executable [args for the executable]

/path/to/outdir will contain lcov-style HTML output generated continuously while the application runs. Kcov will also write cobertura- compatible XML output and can upload coverage data directly to http://coveralls.io for easy integration with travis-ci. A generic coverage.json report is also generated which contains summaries for a given binary and each source file.

Filtering output

It's often useful to filter output, since e.g., /usr/include is seldom of interest. This can be done in two ways:

kcov --exclude-pattern=/usr/include --include-pattern=part/of/path,other/path \
      /path/to/outdir executable

which will do a string-comparison and include everything which contains part/of/path or other/path but exclude everything that has the /usr/include string in it.

kcov --include-path=/my/src/path /path/to/outdir executable
kcov --exclude-path=/usr/include /path/to/outdir executable

Does the same thing, but with proper path lookups.

Merging multiple kcov runs

Kcov can also merge the results of multiple earlier runs. To use this mode, call kcov with --merge, an output path and one or more paths to an earlier run, e.g.,

kcov --merge /tmp/merged-output /tmp/kcov-output1 /tmp/kcov-output2
kcov --merge /tmp/merged-output /tmp/kcov-output*    # With a wildcard

Use from continuous integration systems

kcov is easy to integrate with travis-ci together with coveralls.io or codecov.io. It can also be used from Jenkins, SonarQube and GitLab CI. Refer to

  • coveralls for details about travis-ci + coveralls, or
  • codecov for details about travis-ci + codecov
  • jenkins for details about how to integrate in Jenkins
  • sonarqube for how to use kcov and sonarqube together
  • gitlab for use with GitLab

Full-system instrumentation

Kcov can instrument all binaries with very low overhead for embedded systems. Refer to the full system instrumentation documentation for details.

More information

kcov is written by Simon Kagstrom [email protected] and more information can be found at the web page

More Repositories

1

emilpro

Graphical disassembler for almost all architectures under the sun.
C++
150
star
2

despotify

Java
62
star
3

cibyl

A MIPS to Java bytecode binary translator
C
50
star
4

libghthash

Shell
16
star
5

dissy

Deprecated Graphical frontend to the objdump disassembler (note: Replaced by EmilPRO!)
Python
12
star
6

shcov

Coverage test tool for Bourne-Again SHell
Python
10
star
7

frodo

Frodo C64 emulator ported to J2ME devices (using Cibyl)
C++
10
star
8

tesla_dashcam_manager

A manager for tesla_dashcam + teslausb and docker image for Raspberry Pi to run it together with pigallery2
Python
10
star
9

sarien-j2me

A port of the Sarien AGI interpreter to J2ME phones, using Cibyl
C
7
star
10

lessphun

Reimplementation of the Mophun API (old)
C
6
star
11

fronius-to-postgres

Collect data from the Fronius Symo JSON API and store in a PostgreSQL database
Python
4
star
12

mci500h-hack

Replacement firmware and hacks for the Philips MCi500h micro stereo
C
3
star
13

old-projects

Simons old projects
C
3
star
14

coincident

Race condition finder for unit tests
C++
3
star
15

libtremor-streamium

OGG decoding library, integer-only
C
2
star
16

ommpc-streamium

Port of One More Music Player Client to Philips streamium-based boards
C
2
star
17

lorminator_dash

Boulder dash-style game
C++
2
star
18

recept

Simons recept
TeX
1
star
19

mpd-streamium

Music Player Daemon, stuff for Philips streamium
C
1
star
20

c64-network.org

C++
1
star
21

presentations

Simons presentations
TeX
1
star
22

tafl

tafl board game
C++
1
star
23

lttng-scope

C++
1
star
24

thesis

My thesis
TeX
1
star
25

sdl-streamium

Port of libSDL to Philips streamium-based boards
C
1
star
26

mci500h-linux-2.4.27

Linux kernel sources for the MCi500h micro stereo
C
1
star
27

calc

Small silly command-line calculator
C
1
star
28

web-to-image

Docker image to download a webpage as an image
JavaScript
1
star
29

streamium-mpd-gui

SDL-based MPD GUI for the Philips MCI 500h
C++
1
star