Initial release
[adaptation/ap_samsung/gst-plugins-s5pc2xx.git] / common / coverage / lcov.mak
1 ## .PHONY so it always rebuilds it
2 .PHONY: lcov-reset lcov lcov-run lcov-report lcov-upload
3
4 # run lcov from scratch, always
5 lcov-reset:
6         $(MAKE) lcov-run
7         $(MAKE) lcov-report
8
9 # run lcov from scratch if the dir is not there
10 lcov:
11         $(MAKE) lcov-reset
12
13 if GST_GCOV_ENABLED
14 # reset run coverage tests
15 lcov-run:
16         @-rm -rf lcov
17         lcov --directory . --zerocounters
18         -if test -d tests/check; then $(MAKE) -C tests/check inspect; fi
19         -$(MAKE) check
20
21 # generate report based on current coverage data
22 lcov-report:
23         mkdir lcov
24         lcov --compat-libtool --directory . --capture --output-file lcov/lcov.info
25         lcov -l lcov/lcov.info | grep -v "`cd $(top_srcdir) && pwd`" | cut -d: -f1 > lcov/remove
26         lcov -l lcov/lcov.info | grep "tests/check/" | cut -d: -f1 >> lcov/remove
27         lcov -r lcov/lcov.info `cat lcov/remove` > lcov/lcov.cleaned.info
28         rm lcov/remove
29         mv lcov/lcov.cleaned.info lcov/lcov.info
30         genhtml -t "$(PACKAGE_STRING)" -o lcov --num-spaces 2 lcov/lcov.info
31
32 lcov-upload: lcov
33         rsync -rvz -e ssh --delete lcov/* gstreamer.freedesktop.org:/srv/gstreamer.freedesktop.org/www/data/coverage/lcov/$(PACKAGE)
34
35 else
36 lcov-run:
37         echo "Need to reconfigure with --enable-gcov"
38
39 lcov-report:
40         echo "Need to reconfigure with --enable-gcov"
41 endif
42