6d848f52457b913a75dc87754565f9755c1dbcf7
[platform/upstream/gstreamer.git] / common / coverage / lcov.mak
1 # run lcov from scratch, always
2 lcov-reset:
3         make lcov-run
4         make lcov-report
5
6 # run lcov from scratch if the dir is not there
7 lcov:
8         make lcov-reset
9
10 # reset run coverage tests
11 lcov-run:
12         @-rm -rf lcov
13         find . -name "*.gcda" -exec rm {} \;
14         if test -d tests/check; then make -C tests/check inspect; fi
15         make check
16
17 # generate report based on current coverage data
18 lcov-report:
19         mkdir lcov
20         lcov --directory . --capture --output-file lcov/lcov.info
21         lcov -l lcov/lcov.info | grep -v "`cd $(top_srcdir) && pwd`" | cut -d: -f1 > lcov/remove
22         lcov -l lcov/lcov.info | grep "tests/check/" | cut -d: -f1 >> lcov/remove
23         lcov -r lcov/lcov.info `cat lcov/remove` > lcov/lcov.cleaned.info
24         rm lcov/remove
25         mv lcov/lcov.cleaned.info lcov/lcov.info
26         genhtml -t "$(PACKAGE_STRING)" -o lcov lcov/lcov.info
27
28 lcov-upload: lcov
29         rsync -rvz -e ssh --delete lcov/* gstreamer.freedesktop.org:/srv/gstreamer.freedesktop.org/www/data/coverage/lcov/$(PACKAGE)