[gtksourceview] Add code coverage support



commit ca89cc7e40f4bdb9a79e13863c818d4e7878d6e2
Author: SÃbastien Wilmet <swilmet gnome org>
Date:   Sun Jan 6 18:35:43 2013 +0100

    Add code coverage support
    
    New configure option: --enable-code-coverage
    New make target: check-code-coverage
    
    lcov must be installed.
    
    *.gcda and *.gcno files are generated, add them to CLEANFILES.

 Makefile.am       |    2 ++
 configure.ac      |    5 +++++
 tests/Makefile.am |   14 ++++++++++++++
 3 files changed, 21 insertions(+), 0 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index 7585418..38a443c 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -102,4 +102,6 @@ dist-hook:
 		echo A git clone is required to generate a ChangeLog >&2; \
 	fi
 
+ GNOME_CODE_COVERAGE_RULES@
+
 -include $(top_srcdir)/git.mk
diff --git a/configure.ac b/configure.ac
index b40b9f2..456b4f5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -135,6 +135,11 @@ AC_SUBST(GDK_PIXBUF_PREFIX)
 # Introspection
 GOBJECT_INTROSPECTION_CHECK([0.9.0])
 
+# Code coverage
+GNOME_CODE_COVERAGE
+CFLAGS="$CFLAGS $CODE_COVERAGE_CFLAGS"
+LDFLAGS="$LDFLAGS $CODE_COVERAGE_CFLAGS"
+
 # test-widget uses this to find lang files and gtksourcebuffer.c
 ABS_TOP_SRCDIR=`cd $srcdir && pwd`
 AC_SUBST(ABS_TOP_SRCDIR)
diff --git a/tests/Makefile.am b/tests/Makefile.am
index d9bf382..916b7da 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -72,4 +72,18 @@ python_tests =			\
 EXTRA_DIST =				\
 	$(python_tests)
 
+test_sources =					\
+	$(test_buffer_SOURCES)			\
+	$(test_completion_model_SOURCES)	\
+	$(test_completion_SOURCES)		\
+	$(test_languagemanager_SOURCES)		\
+	$(test_printcompositor_SOURCES)		\
+	$(test_widget_SOURCES)			\
+	gtksourcecompletionmodel.c
+
+# Generated files for the code coverage
+CLEANFILES =				\
+	$(test_sources:.c=.gcda) 	\
+	$(test_sources:.c=.gcno)
+
 -include $(top_srcdir)/git.mk



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