• Stars
    star
    128
  • Rank 281,044 (Top 6 %)
  • Language
    Rust
  • Created over 8 years ago
  • Updated about 3 years ago

Reviews

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

Repository Details

Cargo subcommand to run kcov to get coverage report on Linux

cargo-kcov

Build status Coverage Status crates.io MIT

Collect test coverage on all the test cases for the current project using kcov on Linux and macOS.

Usage

In the project run

$ cargo kcov

It will run all test cases and collect coverage statistics via kcov. The coverage report can be read from target/cov/index.html.

Prerequisite

You need to install kcov v26 or above to collect coverage report from Rust. Some distro is still shipping v25 or v11, so you will need to build from source.

For macOS, you will need kcov v35 or above. Be aware that macOS performance is significantly slower when compared with Linux. If you are collecting coverage statistics on the CI and you don't have time to spend, consider ignoring macOS.

Please follow the instruction in https://users.rust-lang.org/t/650. cargo-kcov requires v30 or above since earlier versions of kcov do not report its version number.

cargo-kcov requires Rust 1.20.0 or above (due to bitflags dependency).

Install

cargo-kcov can be installed with cargo install.

$ cargo install cargo-kcov

Options

cargo-kcov 0.5.1
Generate coverage report via kcov

USAGE:
    cargo kcov [OPTIONS] [--] [KCOV-ARGS]...

OPTIONS:
        --lib                      Test only this package's library
        --bin <NAME>...            Test only the specified binary
        --example <NAME>...        Test only the specified example
        --test <NAME>...           Test only the specified integration test target
        --bench <NAME>...          Test only the specified benchmark target
    -j, --jobs <N>                 The number of jobs to run in parallel
        --release                  Build artifacts in release mode, with optimizations
        --features <FEATURES>      Space-separated list of features to also build
        --no-default-features      Do not build the `default` feature
        --target <TRIPLE>          Build for the target triple
        --manifest-path <PATH>     Path to the manifest to build tests for
        --no-fail-fast             Run all tests regardless of failure
        --kcov <PATH>              Path to the kcov executable
    -o, --output <PATH>            Output directory, default to [target/cov]
    -v, --verbose                  Use verbose output
        --all                      In a workspace, test all members
        --open                     Open the coverage report on finish
        --coveralls                Upload merged coverage data to coveralls.io from Travis CI
        --no-clean-rebuild         Do not perform a clean rebuild before collecting coverage. This improves performance
                                   when the test case was already built for coverage, but may cause wrong coverage
                                   statistics if used incorrectly. If you use this option, make sure the `target/`
                                   folder is used exclusively by one rustc/cargo version only, and the test cases are
                                   built with `RUSTFLAGS="-C link-dead-code" cargo test`.
        --print-install-kcov-sh    Prints the sh code that installs kcov to `~/.cargo/bin`. Note that this will *not*
                                   install dependencies required by kcov.
    -h, --help                     Prints help information
    -V, --version                  Prints version information

ARGS:
    <KCOV-ARGS>...    Further arguments passed to kcov. If empty, the default arguments `--verify --exclude-
                      pattern=$CARGO_HOME` will be passed to kcov.

More Repositories

1

iphone-private-frameworks

Headers for private frameworks or undocumented interfaces of iPhoneOS 3.x or before (4.x is not supported yet).
C
1,448
star
2

rust-ios-android

Example project for building a library for iOS + Android in Rust.
Shell
660
star
3

qrcode-rust

QR code encoder in Rust.
Rust
441
star
4

Miscellaneous

This repository contains stuff which would be helpful for jailbroken iOS development.
C++
291
star
5

cov

LLVM-GCOV Source coverage for Rust
Rust
120
star
6

rustup-toolchain-install-master

Install a rustc master toolchain usable from rustup
Rust
73
star
7

pndopt

THIS PROJECT HAS BEEN ABANDONED β€” Puzzle & Dragons optimizer
69
star
8

utils

Useful headers for C++11
C++
64
star
9

ods2md

Convert LibreOffice Calc Spreadsheets (*.ods) into Markdown tables.
Python
51
star
10

CoCCalc

THIS PROJECT HAS BEEN ABANDONED.
51
star
11

dbgen

Generate random test cases for databases
Rust
49
star
12

omgwtf8

Optimized-Matching-Generalized Wobbly Transformation Format β€” 8-bit
Rust
36
star
13

extprim

Extra primitive types (u128, i128) for Rust.
Rust
25
star
14

rand_regex

Generates random strings and byte strings matching a regex
Rust
24
star
15

parse-size

Parse byte size into integer accurately.
Rust
24
star
16

EcaFretni

Python
20
star
17

mbox

malloc-based Box implementation for Rust.
Rust
19
star
18

tzfile

Rust chrono::TimeZone implementation using the system tz database
Rust
19
star
19

Privoxy-iOS

Privoxy for Jailbroken iOS.
C
17
star
20

async-ctrlc

`async-ctrlc` is an async wrapper of the `ctrlc` crate in Rust
Rust
13
star
21

grafana-export

Export Grafana dashboard snapshots as local JSON files
HTML
10
star
22

CatSaver

Automatically save logcat
Java
10
star
23

shary

HTTP server for sharing files and text snippets in LAN
HTML
9
star
24

pyadbdirect

Pure Python module to communicate with an Android device via TCP, without going through the ADB server.
Python
9
star
25

tticomp

.
C++
7
star
26

thin_cstr

Experimental: Make *CStr a thin pointer.
Rust
6
star
27

fwdansi

Forward string with ANSI escape code to `termcolor` terminal
Rust
6
star
28

libimobiledevice-rust

Rust wrapper of libimobiledevice
Rust
5
star
29

borsholder

Combined status board of rust-lang/rust's Homu queue and GitHub PR status.
Rust
5
star
30

lproj2es

Dump iOS localization strings into Elasticsearch
Rust
5
star
31

QuickScroll

Scrollbar for iPhoneOS.
Objective-C
5
star
32

BinarySpec.swift

Parsing binary protocols (for Swift)
Swift
4
star
33

skylight

Skylight is a Go source rewriter which inserts a `println` or `panic` before any statement without coverage
Go
4
star
34

ragel

Unofficial mirror of git://git.complang.org/ragel.git
C++
3
star
35

aar-to-eclipse

Convert *.aar to Android library project for Eclipse ADT
Python
3
star
36

eieio

Error Implementing `Eq + Clone` replacing `std::io::Error`
Rust
3
star
37

mozart2-module-test

Test project to keep track of how to build a module for Mozart VM 2
Shell
3
star
38

tkintertable

Fork of http://tkintertable.googlecode.com which supports Python 3.
Python
3
star
39

711cov

Coverage reporting software for gcov-4.7
Python
3
star
40

ozdss

(just for synchronization.)
Shell
2
star
41

PWAs

TypeScript
2
star
42

distributed-lock-sample

Proof-of-concept of using etcd-rs as a distributed lock
Rust
2
star
43

TTMan3

Time Table Manager 3
JavaScript
2
star
44

log-duration-visualizer

Rust
2
star
45

android-weibo-sdk

**Unofficial** Mirror of https://code.google.com/p/android-weibo-sdk/
Java
2
star
46

dot-vim

.vimrc, .bashrc, etc.
Vim Script
2
star
47

ozzero

ZeroMQ binding in Mozart/Oz 1.4.
C++
1
star
48

aidl2

AIDL2: An improved AIDL
Ruby
1
star
49

AppleLocalization

Deprecated β€” Use https://github.com/kennytm/lproj2es instead.
Python
1
star
50

test-term-coloring

Rust
1
star
51

CBoard

macOS notification center widget to perform quick programming-related tasks
Swift
1
star
52

language-oz

Oz syntax for Atom.
CoffeeScript
1
star
53

QTk85

Port QTk for Tk 8.5+
1
star
54

sphinx-domains

C++11 domain for Sphinx 1.2
Python
1
star
55

gralloc-bug

If you're not an Android board manufacturor, nothing to see here, move along.
Java
1
star