Enlightenment CVS committal Author : doursse Project : e17 Module : libs/ewl
Dir : e17/libs/ewl Modified Files: configure.in Makefile.am Log Message: Add the creation of coverage report with gcov and lcov * --enable-gcov must be passed to configure * right now, you have to install ewl to use that feature * 'make lcov' launches all the unit tests and create the report in the lcov subdirectory * 'make lcov EWL_UNIT_TEST=my_test' launches only the test my_test and created the coverage report =================================================================== RCS file: /cvs/e/e17/libs/ewl/configure.in,v retrieving revision 1.125 retrieving revision 1.126 diff -u -3 -r1.125 -r1.126 --- configure.in 11 Dec 2007 05:51:21 -0000 1.125 +++ configure.in 12 Dec 2007 09:09:57 -0000 1.126 @@ -21,6 +21,49 @@ define([AC_LIBTOOL_LANG_F77_CONFIG], [:])dnl AC_PROG_LIBTOOL +dnl Define these at the bottom as they are not release versions, but API +dnl revisions numbers. +INTERFACE_CURRENT="1" +INTERFACE_REVISION="0" +INTERFACE_AGE="0" +INTERFACE_VERSION=${INTERFACE_CURRENT}:${INTERFACE_REVISION}:${INTERFACE_AGE} + +AC_SUBST(INTERFACE_VERSION) + +AC_DEFINE_UNQUOTED(INTERFACE_CURRENT, "$INTERFACE_CURRENT", [Interface current version number]) +AC_DEFINE_UNQUOTED(INTERFACE_REVISION, "$INTERFACE_REVISION", [Interface revision number]) +AC_DEFINE_UNQUOTED(INTERFACE_AGE, "$INTERFACE_AGE", [Interface age number]) + +AC_ARG_ENABLE(gcov, + AC_HELP_STRING([--enable-gcov], + [compile with coverage profiling instrumentation]), + [enable_gcov=$enableval], + [enable_gcov="no"] +) +AC_MSG_CHECKING([whether to use profiling instrumentation]) +AC_MSG_RESULT($enable_gcov) + +if test "x$enable_gcov" = "xyes" ; then + AC_CHECK_PROG(have_lcov, + [lcov], + [yes], + [no] + ) + if test "x$have_lcov" = "xyes" ; then + GCOV_CFLAGS="-fprofile-arcs -ftest-coverage" + GCOV_LIBS="-lgcov" +dnl remove any optimisation flag + CFLAGS="-O0" + else + AC_MSG_WARN([lcov is not found, disable profiling instrumentation]) + enable_gcov="no" + fi +fi +AC_SUBST(GCOV_CFLAGS) +AC_SUBST(GCOV_LIBS) + +AM_CONDITIONAL(EWL_ENABLE_GCOV, test "x$enable_gcov" = "xyes") + AC_FUNC_ALLOCA AC_CHECK_HEADERS([pwd.h grp.h langinfo.h fcntl.h]) @@ -209,20 +252,6 @@ AM_CONDITIONAL(EWL_TESTS_BUILD, test "x$enable_tests" = "xyes") -### -# Define these at the bottom as they are not release versions, but API -# revisions numbers. -INTERFACE_CURRENT="1" -INTERFACE_REVISION="0" -INTERFACE_AGE="0" -INTERFACE_VERSION=${INTERFACE_CURRENT}:${INTERFACE_REVISION}:${INTERFACE_AGE} - -AC_SUBST(INTERFACE_VERSION) - -AC_DEFINE_UNQUOTED(INTERFACE_CURRENT, "$INTERFACE_CURRENT", [Interface current version number]) -AC_DEFINE_UNQUOTED(INTERFACE_REVISION, "$INTERFACE_REVISION", [Interface revision number]) -AC_DEFINE_UNQUOTED(INTERFACE_AGE, "$INTERFACE_AGE", [Interface age number]) - AC_SUBST(ewl_media_include) AC_SUBST(requirements) @@ -344,6 +373,8 @@ echo " Epsilon Support..........................: $have_epsilon" echo echo "Debug Support..............................: $enable_debug" +echo +echo "Coverage Support...........................: $enable_gcov" echo echo "Build tests................................: $enable_tests" echo =================================================================== RCS file: /cvs/e/e17/libs/ewl/Makefile.am,v retrieving revision 1.33 retrieving revision 1.34 diff -u -3 -r1.33 -r1.34 --- Makefile.am 6 Dec 2007 18:46:09 -0000 1.33 +++ Makefile.am 12 Dec 2007 09:09:57 -0000 1.34 @@ -31,3 +31,40 @@ pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = ewl.pc + +if EWL_ENABLE_GCOV +lcov-reset: + @rm -rf lcov + @find . -name "*.gcda" -exec rm {} \; + @lcov --directory . --zerocounters + +lcov-report: + @mkdir lcov + @lcov --compat-libtool --directory . --capture --output-file lcov/lcov.info + @lcov -l lcov/lcov.info | grep -v "`cd $(top_srcdir) && pwd`" | cut -d: -f1 > lcov/remove + @lcov -r lcov/lcov.info `cat lcov/remove` > lcov/lcov.cleaned.info + @rm lcov/remove + @mv lcov/lcov.cleaned.info lcov/lcov.info + @genhtml -t "$(PACKAGE_STRING)" -o lcov lcov/lcov.info + +lcov: + @make lcov-reset + @if test "x$(EWL_UNIT_TEST)" = "x" ; then \ + ewl_test -unit -all; \ + else \ + ewl_test -unit $(EWL_UNIT_TEST); \ + fi + @make lcov-report + +clean-local: + @rm -rf lcov +else +lcov-reset: + @echo "reconfigure with --enable-gcov" + +lcov-report: + @echo "reconfigure with --enable-gcov" + +lcov: + @echo "reconfigure with --enable-gcov" +endif ------------------------------------------------------------------------- SF.Net email is sponsored by: Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs