forked from imazen/imageflow
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cov.sh
executable file
·43 lines (35 loc) · 1.21 KB
/
cov.sh
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
#!/bin/bash
set -e
rm -rf ./target/{c_cov,rust_cov,rust_coverage,c_coverage} || true
for i in ./target/debug/imageflow*-[0-9a-f][0-9a-f]*
do
if [[ "$i" == *.* ]]; then
echo "Skipping $i"
else
echo "Covering $i"
DIR="./target/rust_coverage/$(basename "$i")"
mkdir -p "$DIR"
kcov --exclude-pattern=/.cargo,/usr,/tests --include-path=./c_components/lib,./imageflow_core/src,./imageflow_server/src,./imageflow_tool/src,./imageflow_types/src,./imageflow_helpers/src "$DIR" "$i"
fi
done
for i in ./c_components/build/bin/test_*
do
if [[ "$i" == *.* ]]; then
echo "Skipping $i"
else
echo "Covering $i"
DIR="./target/c_coverage/$(basename "$i")"
mkdir -p "$DIR"
kcov --exclude-pattern=/.cargo,/usr,/tests "$DIR" "$i"
fi
done
echo "Merging $(ls ./target/c_coverage)"
kcov --merge ./target/c_cov ./target/coverage/*/
echo "Merging $(ls ./target/rust_coverage)"
kcov --merge ./target/rust_cov ./target/coverage/*/
if [[ "$CODECOV" == "True" ]]; then
echo "Uploading to codecov.io"
bash <(curl -s https://codecov.io/bash) -s ./target/c_cov
bash <(curl -s https://codecov.io/bash) -s ./target/rust_cov
fi
#kcov --merge ./target/cov /home/n/.docker_imageflow_caches/.docker_build_if_gcc48_x86-64/target/coverage/*/