Skip to content

Commit

Permalink
Merge pull request #447 from SimonKagstrom/446-documentation-bring-ma…
Browse files Browse the repository at this point in the history
…n-page-up-to-date-with-the-options

446 documentation bring man page up to date with the options
  • Loading branch information
SimonKagstrom authored Jul 9, 2024
2 parents 83f9123 + bf2c594 commit ade015b
Show file tree
Hide file tree
Showing 15 changed files with 41 additions and 1,206 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,14 @@ 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
---------------------------------------
Integration with other systems
------------------------------
kcov is easy to integrate with [travis-ci](http://travis-ci.org) together with
[coveralls.io](http://coveralls.io) or [codecov.io](http://codecov.io). It can also
be used from Jenkins, [SonarQube](http://sonarqube.org) and [GitLab CI](http://gitlab.com).
Refer to

* [vscode](doc/vscode.md) for details about vscode + coverage gutters
* [coveralls](doc/coveralls.md) for details about travis-ci + coveralls, or
* [codecov](doc/codecov.md) for details about travis-ci + codecov
* [jenkins](doc/jenkins.md) for details about how to integrate in Jenkins
Expand Down
19 changes: 19 additions & 0 deletions doc/kcov.1
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ Don't accumulate data from multiple runs.
\fB\-\-collect\-only
Only collect coverage data, don't produce HTML/Cobertura output.
.TP
\fB\-\-dump\-summary
Dump a brief coverage summary on stdout after execution
.TP
\fB\-\-report\-only
Only report HTML/Cobertura output, don't collect data.
.TP
Expand Down Expand Up @@ -121,6 +124,10 @@ want this behavior, this option turns that off.
\fB\-\-bash\-parse\-files\-in\-dir\fP=\fIP1\fP[\fI,P2\fP...]
Parse directories for bash scripts.
.TP
\fB\-\-bash\-tracefd\-closeexec
Force children to not be traced by configuring the trace fd as non-cloneable with
LD_PRELOAD. Buggy on some systems.
.TP
\fB\-\-replace\-src\-path\fP=\fIP1\fP:\fIP2\fP
Replace source file path P1 with P2, if found.
.TP
Expand All @@ -130,6 +137,18 @@ for more information on full-system instrumentation.
.TP
\fB\-\-system\-report
Produce coverage output for a full-system coverage run.
.TP
\fB\-\-debug\fP=\fIlevel\fP
Set the debug level, 0...31 (as a mask). Default is 0 for no debug output.
.TP
\fB\-\-output\-interval\fP=\fIMS\fP
Set the output writing interval in milliseconds. The default is 5000.
.TP
\fB\-\-configure\fP=\fIKEY=VAL\fP
Configure key/value pairs of internal options. See -\-help \-\-uncommon\-options for possible configuration options.
.TP
\fB\-\-patchelf\fP=\fPCMD\fP
For system mode, set the patchelf command (default patchelf).
.RE
.SH EXAMPLES
.PP
Expand Down
17 changes: 17 additions & 0 deletions doc/vscode.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Integration with vscode
-----------------------
It's easy to produce output for parsing with the [coverage gutters](https://marketplace.visualstudio.com/items?itemName=ryanluker.vscode-coverage-gutters)
extension to vscode. The `--cobertura-only` option is well-suited for this, which only outputs a
`cov.xml` file and the coverage database in the output directory. Coverage information can then
be directly shown in the "gutter" beside the editor, and is automatically updated by the
extension when the coverage changes.

To produce this output, just run

```
kcov --cobertura-only [other options] /path/to/your/folder/.vscode /path/to/the/binary
```

The coverage gutters extension looks for `cov.xml` files in the workspace, but for performance
reasons, it's good to configure it to only look where the kcov output is (`.vscode`) in this
example.
6 changes: 0 additions & 6 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,6 @@ if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
find_package (LibElf)
find_package (ElfUtils)
set (ELF_SRCS
engines/clang-coverage-engine.cc
engines/ptrace.cc
engines/ptrace_linux.cc
engines/kernel-engine.cc
Expand All @@ -187,7 +186,6 @@ elseif (CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
find_package (LibElf)
find_package (ElfUtils)
set (ELF_SRCS
engines/clang-coverage-engine.cc
engines/ptrace.cc
engines/ptrace_freebsd.cc
parsers/elf.cc
Expand Down Expand Up @@ -230,7 +228,6 @@ set (${KCOV}_SRCS
engines/system-mode-file-format.cc
engines/python-engine.cc
filter.cc
gcov.cc
main.cc
merge-file-parser.cc
output-handler.cc
Expand All @@ -249,7 +246,6 @@ set (${KCOV}_SRCS
${ELF_SRCS}
${MACHO_SRCS}
include/capabilities.hh
include/gcov.hh
include/reporter.hh
include/collector.hh
include/generated-data-base.hh
Expand All @@ -276,14 +272,12 @@ set (KCOV_SYSTEM_MODE_SRCS
engines/ptrace.cc
engines/ptrace_linux.cc
filter.cc
gcov.cc
include/capabilities.hh
include/collector.hh
include/configuration.hh
include/engine.hh
include/file-parser.hh
include/filter.hh
include/gcov.hh
include/generated-data-base.hh
include/lineid.hh
include/manager.hh
Expand Down
11 changes: 0 additions & 11 deletions src/configuration.cc
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ class Configuration : public IConfiguration
{ "path-strip-level", required_argument, 0, 'S' },
{ "skip-solibs", no_argument, 0, 'L' },
{ "exit-first-process", no_argument, 0, 'F' },
{ "gcov", no_argument, 0, 'g' },
{ "clang", no_argument, 0, 'c' },
{ "configure", required_argument, 0, 'M' },
{ "clean", no_argument, 0, 'E' },
Expand Down Expand Up @@ -217,12 +216,6 @@ class Configuration : public IConfiguration
case 'F':
setKey("daemonize-on-first-process-exit", 1);
break;
case 'g':
setKey("gcov", 1);
break;
case 'c':
setKey("clang-sanitizer", 1);
break;
case 'E':
setKey("clean-output", 1);
break;
Expand Down Expand Up @@ -572,8 +565,6 @@ class Configuration : public IConfiguration
setKey("path-strip-level", 2);
setKey("attach-pid", 0);
setKey("parse-solibs", 1);
setKey("gcov", 0);
setKey("clang-sanitizer", 0);
setKey("clean-output", 0);
setKey("low-limit", 25);
setKey("high-limit", 75);
Expand Down Expand Up @@ -707,8 +698,6 @@ class Configuration : public IConfiguration
" --path-strip-level=num path levels to show for common paths (default: %d)\n"
"\n"
" --cobertura-only Only produce cobertura output in the output dir\n"
" --gcov use gcov parser instead of DWARF debugging info\n"
" --clang use Clang Sanitizer-coverage parser\n"
" --dump-summary dump a summary of coverage on stdout\n"
" --system-record perform full-system instrumentation\n"
" --system-report report full-system coverage data\n"
Expand Down
Loading

0 comments on commit ade015b

Please sign in to comment.