From c1d877dc862f8510c160c355822ef613a0b2f567 Mon Sep 17 00:00:00 2001 From: caro Date: Sun, 1 Jul 2012 12:01:46 +0000 Subject: [PATCH] Eet: remove --enable-coverage option. Now, coverage is detected with just --enable-tests. Buildbot maintainers : please remove --enable-coverage option to eet (more EFL will be supported later) git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/eet@73108 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- Makefile.am | 35 +++++++++++------------------- configure.ac | 21 ++++++------------ m4/efl_coverage.m4 | 62 ------------------------------------------------------ m4/efl_tests.m4 | 28 +++++++++++++++++++++--- 4 files changed, 43 insertions(+), 103 deletions(-) delete mode 100644 m4/efl_coverage.m4 diff --git a/Makefile.am b/Makefile.am index 78b226a..79b2a28 100644 --- a/Makefile.am +++ b/Makefile.am @@ -36,7 +36,6 @@ m4/ac_path_generic.m4 \ m4/efl_binary.m4 \ m4/efl_check_funcs.m4 \ m4/efl_check_libs.m4 \ -m4/efl_coverage.m4 \ m4/efl_doxygen.m4 \ m4/efl_tests.m4 \ m4/efl_path_max.m4 @@ -44,7 +43,7 @@ m4/efl_path_max.m4 pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = eet.pc -.PHONY: doc coverage +.PHONY: doc # Documentation @@ -56,19 +55,6 @@ doc: if EFL_ENABLE_TESTS -check-local: - @./src/tests/eet_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 @@ -81,20 +67,23 @@ 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" -coverage: +check-local: @$(MAKE) lcov-reset - @$(MAKE) check + @./src/tests/eet_suite @$(MAKE) lcov-report -clean-local: - @rm -rf coverage else + lcov-reset: - @echo "reconfigure with --enable-coverage" + @echo "reconfigure with --enable-tests" lcov-report: - @echo "reconfigure with --enable-coverage" + @echo "reconfigure with --enable-tests" + +check-local: + @echo "reconfigure with --enable-tests" -coverage: - @echo "reconfigure with --enable-tests --enable-coverage" endif + +clean-local: + @rm -rf coverage diff --git a/configure.ac b/configure.ac index 852dc04..4f91427 100644 --- a/configure.ac +++ b/configure.ac @@ -186,19 +186,6 @@ AC_ARG_ENABLE([build-examples], [build_examples="no"]) AM_CONDITIONAL([BUILD_EXAMPLES], [test "x${build_examples}" = "xyes"]) -# Unit tests, coverage and benchmarking - -EFL_CHECK_TESTS([enable_tests="yes"], [enable_tests="no"]) -EFL_CHECK_COVERAGE([${enable_tests}], [enable_coverage="yes"], [enable_coverage="no"]) - -if test "x${prefer_assert}" = "xno"; then - DEBUG_CFLAGS="-DNDEBUG" -else -# use debug symbols and set DEBUG if coverage support is enabled - DEBUG_CFLAGS="${EFL_DEBUG_CFLAGS}" -fi -AC_SUBST(DEBUG_CFLAGS) - ### Checks for programs AC_PROG_CC @@ -492,6 +479,11 @@ AC_CHECK_FUNCS(fmemopen open_memstream realpath) EFL_CHECK_FUNCS([eet], [fnmatch]) +### Unit tests, coverage and benchmarking + +EFL_CHECK_TESTS([eet], [enable_tests="yes"], [enable_tests="no"]) + + AC_SUBST([requirements_pc_eet]) AC_SUBST([requirements_libs_eet]) @@ -530,8 +522,7 @@ fi echo echo " Old eet file format..: ${old_eet_file_format}" echo -echo " Tests................: ${enable_tests}" -echo " Coverage.............: ${enable_coverage}" +echo " Tests................: ${enable_tests} (Coverage: ${efl_enable_coverage})" echo echo " Build eet............: $have_eet" echo diff --git a/m4/efl_coverage.m4 b/m4/efl_coverage.m4 deleted file mode 100644 index 85d0321..0000000 --- a/m4/efl_coverage.m4 +++ /dev/null @@ -1,62 +0,0 @@ -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 - -if test "x$_efl_enable_coverage" = "xyes" ; then - AC_CHECK_PROG(have_lcov, [lcov], [yes], [no]) - if test "x$have_lcov" = "xyes" ; then - EFL_COVERAGE_CFLAGS="-fprofile-arcs -ftest-coverage" - EFL_COVERAGE_LIBS="-lgcov" -# remove any optimisation flag and force debug symbols - EFL_DEBUG_CFLAGS="-g -O0 -DDEBUG" - else - AC_MSG_WARN([lcov is not found, disable profiling instrumentation]) - _efl_enable_coverage="no" - fi -fi - -dnl Substitution -AC_SUBST(EFL_COVERAGE_CFLAGS) -AC_SUBST(EFL_COVERAGE_LIBS) - -AM_CONDITIONAL(EFL_ENABLE_COVERAGE, test "x${_efl_enable_coverage}" = "xyes") - -AS_IF([test "x$_efl_enable_coverage" = "xyes"], [$2], [$3]) -]) - -dnl End of efl_coverage.m4 diff --git a/m4/efl_tests.m4 b/m4/efl_tests.m4 index 3a4dfe2..edd57f2 100644 --- a/m4/efl_tests.m4 +++ b/m4/efl_tests.m4 @@ -1,14 +1,16 @@ -dnl Copyright (C) 2008 Vincent Torri +dnl Copyright (C) 2008-2012 Vincent Torri dnl That code is public domain and can be freely used or copied. dnl Macro that check if tests programs are wanted and if yes, if dnl the Check library is available. +dnl the lcov program is available. -dnl Usage: EFL_CHECK_TESTS([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) +dnl Usage: EFL_CHECK_TESTS(EFL[, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) dnl Define the automake conditionnal EFL_ENABLE_TESTS AC_DEFUN([EFL_CHECK_TESTS], [ +m4_pushdef([UPEFL], m4_translit([$1], [-a-z], [_A-Z]))dnl dnl configure option @@ -35,9 +37,29 @@ if test "x${_efl_enable_tests}" = "xyes" ; then [_efl_enable_tests="no"]) fi +efl_enable_coverage="no" +if test "x${_efl_enable_tests}" = "xyes" ; then + AC_CHECK_PROG(have_lcov, [lcov], [yes], [no]) + if test "x$have_lcov" = "xyes" ; then + m4_defn([UPEFL])[]_CFLAGS="${m4_defn([UPEFL])[]_CFLAGS} -fprofile-arcs -ftest-coverage" + m4_defn([UPEFL])[]_LIBS="${m4_defn([UPEFL])[]_LIBS} -lgcov" +# remove any optimisation flag and force debug symbols + m4_defn([UPEFL])[]_CFLAGS="${m4_defn([UPEFL])[]_CFLAGS} -g -O0 -DDEBUG" + efl_enable_coverage="yes" + else + AC_MSG_WARN([lcov is not found, disable profiling instrumentation]) + fi +fi + +dnl Substitution +AC_SUBST(EFL_COVERAGE_CFLAGS) +AC_SUBST(EFL_COVERAGE_LIBS) + AM_CONDITIONAL(EFL_ENABLE_TESTS, test "x${_efl_enable_tests}" = "xyes") -AS_IF([test "x$_efl_enable_tests" = "xyes"], [$1], [$2]) +AS_IF([test "x$_efl_enable_tests" = "xyes"], [$2], [$3]) + +m4_popdef([UPEFL]) ]) dnl End of efl_tests.m4 -- 2.7.4