]> git.proxmox.com Git - rustc.git/blob - src/vendor/regex-0.1.80/run-kcov
New upstream version 1.19.0+dfsg1
[rustc.git] / src / vendor / regex-0.1.80 / run-kcov
1 #!/bin/bash
2
3 set -e
4
5 tests=(
6 default
7 default_bytes
8 backtrack
9 backtrack_utf8bytes
10 backtrack_bytes
11 nfa
12 nfa_utf8bytes
13 nfa_bytes
14 regex
15 regex_inline
16 )
17 tmpdir=$(mktemp -d)
18 with_plugin=
19 coveralls_id=
20
21 while true; do
22 case "$1" in
23 --with-plugin)
24 with_plugin=yes
25 shift
26 ;;
27 --coveralls-id)
28 coveralls_id="$2"
29 shift 2
30 ;;
31 *)
32 break
33 ;;
34 esac
35 done
36
37 if [ -n "$with_plugin" ]; then
38 cargo test --manifest-path regex_macros/Cargo.toml --no-run --verbose
39 kcov \
40 --verify \
41 --include-pattern '/regex/src/' \
42 "$tmpdir/plugin" \
43 $(ls -t ./regex_macros/target/debug/plugin-* | head -n1)
44 fi
45
46 cargo test --no-run --verbose
47 for t in ${tests[@]}; do
48 kcov \
49 --verify \
50 --include-pattern '/regex/src/' \
51 "$tmpdir/$t" \
52 $(ls -t ./target/debug/"$t"-* | head -n1)
53 done
54
55 if [ -n "$coveralls_id" ]; then
56 kcov --verify --coveralls-id=$coveralls_id --merge target/cov "$tmpdir"/*
57 else
58 kcov --verify --merge target/cov "$tmpdir"/*
59 fi