forked from rust-lang/regex
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run-kcov
executable file
·59 lines (53 loc) · 1018 Bytes
/
run-kcov
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/bin/bash
set -e
tests=(
default
default_bytes
backtrack
backtrack_utf8bytes
backtrack_bytes
nfa
nfa_utf8bytes
nfa_bytes
regex
regex_inline
)
tmpdir=$(mktemp -d)
with_plugin=
coveralls_id=
while true; do
case "$1" in
--with-plugin)
with_plugin=yes
shift
;;
--coveralls-id)
coveralls_id="$2"
shift 2
;;
*)
break
;;
esac
done
if [ -n "$with_plugin" ]; then
cargo test --manifest-path regex_macros/Cargo.toml --no-run --verbose
kcov \
--verify \
--include-pattern '/regex/src/' \
"$tmpdir/plugin" \
$(ls -t ./regex_macros/target/debug/plugin-* | head -n1)
fi
cargo test --no-run --verbose
for t in ${tests[@]}; do
kcov \
--verify \
--include-pattern '/regex/src/' \
"$tmpdir/$t" \
$(ls -t ./target/debug/"$t"-* | head -n1)
done
if [ -n "$coveralls_id" ]; then
kcov --verify --coveralls-id=$coveralls_id --merge target/cov "$tmpdir"/*
else
kcov --verify --merge target/cov "$tmpdir"/*
fi