-
Notifications
You must be signed in to change notification settings - Fork 5
/
cov-tests
executable file
·40 lines (36 loc) · 1.31 KB
/
cov-tests
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
#!/bin/sh
case "$1" in
clean)
if [ -e "arki/tests/arki-test" ]
then
echo "Please run make clean first" >&1
exit 1
fi
find arki src -name "*.gcda" -delete
find arki src -name "*.gcno" -delete
find arki src -name "*.gcov" -delete
find . -maxdepth 1 -name "*.gcov" -delete
rm -f trace_*.info
;;
browse)
sensible-browser file://`pwd`/lcov/index.html
;;
*)
lcov --zerocounters --directory arki
make check -C arki "$@"
rm -f trace_arki.info
lcov --capture --directory arki --base-directory arki --output-file trace_arki.info --test-name testarki
lcov --zerocounters --directory arki
lcov --zerocounters --directory src
make check -C src "$@"
rm -f trace_src1.info trace_src2.info
lcov --capture --directory arki --base-directory arki --output-file trace_src1.info --test-name testsrc
lcov --capture --directory src --base-directory src --output-file trace_src2.info --test-name testsrc
rm -f trace_all.info
lcov -a trace_arki.info -a trace_src1.info -a trace_src2.info -o trace_all.info
lcov --remove trace_all.info "*-tut.cc" -o trace_all1.info
lcov --remove trace_all1.info "/usr/include/*" -o trace_all.info
genhtml trace_all.info --output-directory lcov --title "Test coverage" --show-details --legend
echo "Please point browser to file://`pwd`/lcov/index.html"
;;
esac