[pygobject] Add support for lcov code coverage



commit f1a5f1b92d577c542d4258e63e595d4da9acd484
Author: Martin Pitt <martinpitt gnome org>
Date:   Thu Nov 8 14:54:30 2012 +0100

    Add support for lcov code coverage
    
    Use gnome-common's new code coverage flags. Default to enabling code coverage
    in autogen.sh (but not for dist).
    
    To use this, run "make check-code-coverage" after building.

 .gitignore   |    1 +
 Makefile.am  |    2 ++
 autogen.sh   |    2 +-
 configure.ac |    6 ++++++
 4 files changed, 10 insertions(+), 1 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index e8d239e..de5c0fc 100644
--- a/.gitignore
+++ b/.gitignore
@@ -60,6 +60,7 @@ Makefile.in
 /py-compile
 /pygobject-3.0-uninstalled.pc
 /pygobject-3.0.pc
+/pygobject-*-coverage*
 /so_locations
 /stamp-h1
 /tags
diff --git a/Makefile.am b/Makefile.am
index 44623a1..adb0105 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -144,3 +144,5 @@ check.nemiver:
 
 check.valgrind:
 	cd tests && $(MAKE) check.valgrind
+
+ GNOME_CODE_COVERAGE_RULES@
diff --git a/autogen.sh b/autogen.sh
index 88ce246..e10f311 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -16,4 +16,4 @@ fi
 autoreconf --force --install --verbose || exit $?
 
 cd "$olddir"
-test -n "$NOCONFIGURE" || "$srcdir/configure" "$@"
+test -n "$NOCONFIGURE" || "$srcdir/configure" --enable-code-coverage "$@"
diff --git a/configure.ac b/configure.ac
index 773cc66..0824be6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -249,6 +249,11 @@ if test "x$GCC" = "xyes"; then
 
 fi
 
+# enable code coverage support
+GNOME_CODE_COVERAGE
+CFLAGS="$CFLAGS $CODE_COVERAGE_CFLAGS"
+LDFLAGS="$LDFLAGS $CODE_COVERAGE_CFLAGS"
+
 AC_CONFIG_FILES(
   Makefile
   pygobject-3.0.pc
@@ -270,5 +275,6 @@ AC_MSG_RESULT([
 	libffi support:			$have_libffi
 	cairo support:			$enable_cairo
 	thread support:			$enable_thread
+	code coverage support:          $enable_code_coverage
 ])
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]