kcov

From Gentoo Wiki
Jump to:navigation Jump to:search
This article is a stub. Please help out by expanding it - how to get started.

kcov is a code coverage tool.

Installation

USE flags

USE flags for dev-util/kcov Kcov is a code coverage tester for compiled languages, Python and Bash

+binutils Use sys-libs/binutils-libs for `--verify` support
test Enable dependencies and/or preparations necessary to run tests (usually controlled by FEATURES=test but can be toggled independently)

Emerge

As of 2024-07-19 the package has no maintainer, the latest available version is 40, which has significant bugs. Therefore, it is better to install the mainline package (version > 42). The mainline package does not require patching on musl-based systems.

Mainline package

FILE /etc/portage/package.accept_keywords
=dev-util/kcov-9999 **
root #emerge --ask dev-util/kcov

Outdated package

root #emerge --ask dev-util/kcov

To install the package on a musl-based system, the following patch needs to be applied:

FILE /etc/portage/patches/dev-util/kcov-40/ptrace.patch
--- a/src/engines/ptrace_linux.cc
+++ b/src/engines/ptrace_linux.cc
@@ -8,6 +8,8 @@
 #  include <elf.h>
 #endif

+typedef int __ptrace_request;
+
 #include <dirent.h>
 #include <sched.h>
 #include <stdio.h>