gjs r70 - trunk
- From: tko svn gnome org
- To: svn-commits-list gnome org
- Subject: gjs r70 - trunk
- Date: Mon, 3 Nov 2008 13:37:38 +0000 (UTC)
Author: tko
Date: Mon Nov 3 13:37:38 2008
New Revision: 70
URL: http://svn.gnome.org/viewvc/gjs?rev=70&view=rev
Log:
Bug 559079 â generate code coverage report
* Makefile-test.am:
* configure.ac: add --enable-coverage configure option to enable
lcov
Modified:
trunk/Makefile-test.am
trunk/configure.ac
Modified: trunk/Makefile-test.am
==============================================================================
--- trunk/Makefile-test.am (original)
+++ trunk/Makefile-test.am Mon Nov 3 13:37:38 2008
@@ -109,3 +109,28 @@
test/js/testMainloop.js \
test/js/testSignals.js \
test/js/testTweener.js
+
+########################################################################
+if ENABLE_COVERAGE
+lcov:
+ test -d lcov || mkdir lcov
+ $(LCOV) --compat-libtool --directory . --capture -o lcov/lcov.info
+ $(GENHTML) --legend -o lcov lcov/lcov.info
+
+lcov-clean:
+ find . -name '*.gcda' -delete
+ rm -rf lcov
+
+lcov-realclean: lcov-clean
+ find . -name '*.gcno' -delete
+
+clean-local: lcov-realclean
+
+.PHONY: lcov lcov-clean lcov-realclean
+else
+lcov:
+ @echo >&1 "*** ERROR: 'configure --enable-coverage' required"
+ @exit 1
+
+.PHONY: lcov
+endif
Modified: trunk/configure.ac
==============================================================================
--- trunk/configure.ac (original)
+++ trunk/configure.ac Mon Nov 3 13:37:38 2008
@@ -24,6 +24,27 @@
AC_PROG_LIBTOOL
dnl DOLT
+# coverage
+AC_ARG_ENABLE([coverage],
+ [AS_HELP_STRING([--enable-coverage],
+ [enable code coverage])],
+ , [enable_coverage=no])
+if test x$enable_coverage = xyes; then
+ if test x$GCC != xyes; then
+ AC_MSG_ERROR([GCC is required for --enable-coverage])
+ fi
+
+ AC_PATH_TOOL([LCOV], [lcov])
+ AC_PATH_TOOL([GENHTML], [genhtml])
+
+ if test x$LCOV = x || test x$GENHTML = x; then
+ AC_MSG_ERROR([lcov and genhtml are required for --enable-coverage])
+ fi
+
+ CFLAGS="$CFLAGS -g -O0 -fprofile-arcs -ftest-coverage"
+fi
+AM_CONDITIONAL([ENABLE_COVERAGE], [test x$enable_coverage = xyes])
+
# Checks for libraries.
m4_define(gobject_required_version, 2.16.0)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]