]> git.proxmox.com Git - rustc.git/blob - vendor/addr2line/coverage
New upstream version 1.46.0~beta.2+dfsg1
[rustc.git] / vendor / addr2line / coverage
1 #!/usr/bin/env bash
2 #
3 # Usage:
4 # ./coverage
5 #
6 # Run kcov on the tests, and merge the results.
7 #
8 # Environment variables:
9 # TRAVIS_JOB_ID - id for coveralls, defaults to none
10 # KCOV - path to kcov, defaults to 'kcov'
11
12 [ -n "$TRAVIS_JOB_ID" ] && COVERALLS_ID="--coveralls-id=$TRAVIS_JOB_ID"
13 [ -z "$KCOV" ] && KCOV=kcov
14
15 # Rebuild tests with dead code included, and get a list of the filenames.
16 export RUSTFLAGS="-C link-dead-code"
17 TEST_FILES=$(cargo test 2>&1 >/dev/null | awk '/^ Running target\/debug\// { print $2 }')
18
19 KCOV_OPTS="--verify --exclude-pattern=/.cargo"
20 OUT_DIR=target/kcov
21
22 for f in $TEST_FILES; do
23 "$KCOV" $KCOV_OPTS "$OUT_DIR" $f
24 done
25 "$KCOV" --merge $KCOV_OPTS $COVERALLS_ID "$OUT_DIR" "$OUT_DIR"
26