[E-devel] [PATCH] eina-1.7: allow running the testsuite independantly of coverage support

2012-12-29 Thread Albin Tonnerre
It used to be possible to run the testsuite whether coverage was enabled
or not; this is very useful for eg. distros who want to automatically
run the testsuite without having to compile with coverage support.

Most other EFL in the stable branch already allow this (evas, ecore,
edje); update Eina to bring it in line with them.
---
 Makefile.am   |   29 -
 configure.ac  |   10 +++-
 m4/common/efl_coverage.m4 |   62 +
 m4/common/efl_tests.m4|   27 +++-
 4 files changed, 97 insertions(+), 31 deletions(-)
 create mode 100644 m4/common/efl_coverage.m4

diff --git a/Makefile.am b/Makefile.am
index 5ff1896..e67c183 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -42,7 +42,8 @@ m4/common/efl_attribute.m4 \
 m4/common/efl_benchmark.m4 \
 m4/common/efl_check_funcs.m4 \
 m4/common/efl_compiler_flag.m4 \
-m4/common/efl_cpu.m4 \
+m4/common/efl_coverage.m4 \
+m4/common/efl_cpu.m4\
 m4/common/efl_doxygen.m4 \
 m4/common/efl_examples.m4 \
 m4/common/efl_path_max.m4 \
@@ -68,6 +69,20 @@ install-doc:
 
 if EFL_ENABLE_TESTS
 
+check-local:
+   @./src/tests/eina_suite
+
+else
+
+check-local:
+   @echo "reconfigure with --enable-tests"
+
+endif
+
+# Coverage report
+
+if EFL_ENABLE_COVERAGE
+
 lcov-reset:
@rm -rf $(top_builddir)/coverage
@find $(top_builddir) -name "*.gcda" -delete
@@ -80,21 +95,21 @@ lcov-report:
genhtml -t "$(PACKAGE_STRING)" -o $(top_builddir)/coverage/html 
$(top_builddir)/coverage/coverage.cleaned.info
@echo "Coverage Report at $(top_builddir)/coverage/html"
 
-check-local:
+coverage:
@$(MAKE) lcov-reset
-   @./src/tests/eina_suite
+   @$(MAKE) check
@$(MAKE) lcov-report
 
 else
 
 lcov-reset:
-   @echo "reconfigure with --enable-tests"
+   @echo "reconfigure with --enable-coverage"
 
 lcov-report:
-   @echo "reconfigure with --enable-tests"
+   @echo "reconfigure with --enable-coverage"
 
-check-local:
-   @echo "reconfigure with --enable-tests"
+coverage:
+   @echo "reconfigure with --enable-tests --enable-coverage"
 
 endif
 
diff --git a/configure.ac b/configure.ac
index d132d15..1775f0e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -553,6 +553,14 @@ EINA_CHECK_MODULE([one-big],[${enable_one_big}],   
   [one big])
 
 EFL_CHECK_TESTS([eina], [enable_tests="yes"], [enable_tests="no"])
 
+EFL_CHECK_COVERAGE([${enable_tests}], [enable_coverage="yes"], 
[enable_coverage="no"])
+EINA_CFLAGS="${EINA_CFLAGS} ${EFL_COVERAGE_CFLAGS} ${EXOTIC_CFLAGS}"
+EINA_LIBS="${EINA_LIBS} ${EFL_COVERAGE_LIBS} ${EXOTIC_LIBS}"
+if test "x$enable_coverage" = "xyes" ; then
+   EINA_CFLAGS="${EINA_CFLAGS} ${EFL_DEBUG_CFLAGS}"
+fi
+
+
 EFL_CHECK_BENCHMARK([enable_benchmark="yes"], [enable_benchmark="no"])
 EINA_BENCH_MODULE([glib], [${enable_benchmark}], [glib-2.0], 
[enable_benchmark_glib="yes"], [enable_benchmark_glib="no"])
 if test -n "$CXX" && test "x$enable_benchmark" = "xyes" ; then
@@ -628,7 +636,7 @@ echo "  Documentation: ${build_doc}"
 if test "x${build_doc}" = "xyes" ; then
 echo "Installation...: make install-doc"
 fi
-echo "  Tests: ${enable_tests} (Coverage: 
${efl_enable_coverage})"
+echo "  Tests: ${enable_tests} (Coverage: ${enable_coverage})"
 echo "  Examples.: ${enable_build_examples}"
 echo "  Tiler Example: ${build_tiler_example}"
 echo "  Examples installed...: ${enable_install_examples}"
diff --git a/m4/common/efl_coverage.m4 b/m4/common/efl_coverage.m4
new file mode 100644
index 000..85d0321
--- /dev/null
+++ b/m4/common/efl_coverage.m4
@@ -0,0 +1,62 @@
+dnl Copyright (C) 2008 Vincent Torri 
+dnl That code is public domain and can be freely used or copied.
+
+dnl Macro that check if coverage support is wanted and, if yes, if
+dnl lcov is available.
+
+dnl Usage: EFL_CHECK_COVERAGE(tests [, ACTION-IF-FOUND [, 
ACTION-IF-NOT-FOUND]])
+dnl The parameter 'tests' is used if a dependency is needed. If set to "yes",
+dnl the dependency is available.
+dnl Defines EFL_COVERAGE_CFLAGS and EFL_COVERAGE_LIBS variables
+dnl Defines the automake conditionnal EFL_ENABLE_COVERAGE
+
+AC_DEFUN([EFL_CHECK_COVERAGE],
+[
+
+dnl configure option
+
+AC_ARG_ENABLE([coverage],
+   [AC_HELP_STRING([--enable-coverage], [enable coverage profiling 
instrumentation @<:@default=disabled@:>@])],
+   [
+if test "x${enableval}" = "xyes" ; then
+   _efl_enable_coverage="yes"
+else
+   _efl_enable_coverage="no"
+fi
+   ],
+   [_efl_enable_coverage="no"])
+
+AC_MSG_CHECKING([whether to use profiling instrumentation])
+AC_MSG_RESULT([$_efl_enable_coverage])
+
+dnl lcov check
+
+if test "x$_efl_enable_coverage" = "xyes" && test ! "x$1" = "xyes" ; then
+   AC_MSG_WARN([Coverage report requested but tests not being built, disable 
profiling instrumentation.])
+   AC_MSG_WARN([Run configure with --enable-tests])
+   _efl_enable_coverage="no"
+fi
+
+i

Re: [E-devel] [PATCH] eina-1.7: allow running the testsuite independantly of coverage support

2013-01-02 Thread Albin Tonnerre
On Sat, Dec 29, 2012 at 2:49 PM, Albin Tonnerre
 wrote:
> It used to be possible to run the testsuite whether coverage was enabled
> or not; this is very useful for eg. distros who want to automatically
> run the testsuite without having to compile with coverage support.
>
> Most other EFL in the stable branch already allow this (evas, ecore,
> edje); update Eina to bring it in line with them.

I kind of expected our beloved autofoo maintainer to apply that patch,
but sadly he has resigned since...
Anybody brave enough to pick it up (or at least comment) ?

Thanks,
--
Albin

--
Master Java SE, Java EE, Eclipse, Spring, Hibernate, JavaScript, jQuery
and much more. Keep your Java skills current with LearnJavaNow -
200+ hours of step-by-step video tutorials by Java experts.
SALE $49.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122612 
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


Re: [E-devel] [PATCH] eina-1.7: allow running the testsuite independantly of coverage support

2013-01-02 Thread The Rasterman
On Wed, 2 Jan 2013 09:38:04 +0100 Albin Tonnerre 
said:

> On Sat, Dec 29, 2012 at 2:49 PM, Albin Tonnerre
>  wrote:
> > It used to be possible to run the testsuite whether coverage was enabled
> > or not; this is very useful for eg. distros who want to automatically
> > run the testsuite without having to compile with coverage support.
> >
> > Most other EFL in the stable branch already allow this (evas, ecore,
> > edje); update Eina to bring it in line with them.
> 
> I kind of expected our beloved autofoo maintainer to apply that patch,
> but sadly he has resigned since...
> Anybody brave enough to pick it up (or at least comment) ?

this mail, like 80+ to enlightenment-devel, has a little tick next to it in y
mailer saying "please deal with me. ktnxbi" :)

> Thanks,
> --
> Albin
> 
> --
> Master Java SE, Java EE, Eclipse, Spring, Hibernate, JavaScript, jQuery
> and much more. Keep your Java skills current with LearnJavaNow -
> 200+ hours of step-by-step video tutorials by Java experts.
> SALE $49.99 this month only -- learn more at:
> http://p.sf.net/sfu/learnmore_122612 
> ___
> enlightenment-devel mailing list
> enlightenment-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
> 


-- 
- Codito, ergo sum - "I code, therefore I am" --
The Rasterman (Carsten Haitzler)ras...@rasterman.com


--
Master Java SE, Java EE, Eclipse, Spring, Hibernate, JavaScript, jQuery
and much more. Keep your Java skills current with LearnJavaNow -
200+ hours of step-by-step video tutorials by Java experts.
SALE $49.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122612 
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel