diff options
author | Rob Taylor <rob.taylor@codethink.co.uk> | 2008-02-08 18:09:05 +0000 |
---|---|---|
committer | Robert James Taylor <robtaylor@src.gnome.org> | 2008-02-08 18:09:05 +0000 |
commit | e2340a78cd657c2398f1076f6f0b87a3dca25540 (patch) | |
tree | 17395722d1bda95d39e4b543cd3739fe4314eeec /gcov.mak | |
parent | b935261f387dffa2c7006fe1be04820004810e87 (diff) | |
download | gobject-introspection-e2340a78cd657c2398f1076f6f0b87a3dca25540.tar.gz |
Added:
2008-02-08 Rob Taylor <rob.taylor@codethink.co.uk>
* Makefile.am:
* configure.ac:
* gcov.mak: Added:
* girepository/Makefile.am:
* m4/Makefile.am: Added:
* m4/as-compiler-flag.m4: Added:
* m4/gcov.m4: Added:
* tools/Makefile.am:
Add ability to generate a coverage report.
Adds configure option --enable-gcov and make rule 'check-coverage'.
svn path=/trunk/; revision=105
Diffstat (limited to 'gcov.mak')
-rw-r--r-- | gcov.mak | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/gcov.mak b/gcov.mak new file mode 100644 index 00000000..74946789 --- /dev/null +++ b/gcov.mak @@ -0,0 +1,21 @@ +if GI_GCOV_ENABLED + +.PHONEY: coverage-report +coverage-report: + @total_covered=0; total_lines=0; \ + for file in $(GCOV_SOURCES); do \ + if test -f $$file.gcov; then \ + covered=`grep -e '[0-9]\+:' $$file.gcov | wc -l` ; \ + uncovered=`grep '#####:' $$file.gcov | wc -l`; \ + lines=$$(($$covered + $$uncovered)); \ + total_covered=$$((total_covered + covered)); \ + total_lines=$$((total_lines + lines)); \ + echo -n " $$file: $$covered / $$lines"; \ + echo " ($$((($$covered * 100) / $$lines))%)"; \ + fi \ + done >> $(top_builddir)/coverage-report.txt; \ + echo -e " Total coverage:"\ + "$$((($$total_covered * 100) / $$total_lines))%\n" \ + >> $(top_builddir)/coverage-report.txt + +endif |