Patch from Vincent Torri that cleanup tests, coverage and benchmark.

SVN revision: 36315
This commit is contained in:
Cedric BAIL 2008-09-29 14:35:28 +00:00
parent 7c47066009
commit b6960f58b6
12 changed files with 184 additions and 120 deletions

View File

@ -41,7 +41,7 @@ doc:
# Unit tests
if EINA_ENABLE_TESTS
if EFL_ENABLE_TESTS
check-local:
@./src/tests/eina_suite
@ -55,7 +55,7 @@ endif
# Coverage report
if EINA_ENABLE_COVERAGE
if EFL_ENABLE_COVERAGE
lcov-reset:
@rm -rf coverage
@find . -name "*.gcda" -exec rm {} \;
@ -85,7 +85,7 @@ coverage:
@echo "reconfigure with --enable-tests --enable-coverage"
endif
if EINA_ENABLE_BENCH
if EFL_ENABLE_BENCHMARK
benchmark:
@make -C src benchmark

View File

@ -55,55 +55,6 @@ if test "x${enable_magic_debug}" = "xyes" ; then
fi
AC_SUBST(EINA_MAGIC_DEBUG)
# Unit tests
AC_ARG_ENABLE([tests],
[AC_HELP_STRING([--enable-tests], [enable tests @<:@default=no@:>@])],
[
if test "x${enableval}" = "xyes" ; then
enable_tests="yes"
else
enable_tests="no"
fi
],
[enable_tests="no"]
)
AC_MSG_CHECKING([whether tests are built])
AC_MSG_RESULT([${enable_tests}])
# Coverage
AC_ARG_ENABLE([coverage],
[AC_HELP_STRING([--enable-coverage], [compile with coverage profiling instrumentation @<:@default=no@:>@])],
[
if test "x${enableval}" = "xyes" ; then
enable_coverage="yes"
else
enable_coverage="no"
fi
],
[enable_coverage="no"]
)
AC_MSG_CHECKING([whether to use profiling instrumentation])
AC_MSG_RESULT([$enable_coverage])
# Benchmarking tests
AC_ARG_ENABLE([benchmark],
[AC_HELP_STRING([--enable-benchmark], [enable tests @<:@default=no@:>@])],
[
if test "x${enableval}" = "xyes" ; then
enable_bench="yes"
else
enable_bench="no"
fi
],
[enable_bench="no"]
)
AC_MSG_CHECKING([whether benchmark are built])
AC_MSG_RESULT([${enable_bench}])
AM_CONDITIONAL(EINA_ENABLE_BENCH, test "x${enable_bench}" = "xyes")
# Ememoa memory pool
AC_ARG_ENABLE([ememoa],
@ -128,6 +79,13 @@ EINA_CHECK_STATIC([ememoa-unknown], [ememoa unknown])
EINA_CHECK_STATIC([pass-through], [pass through])
EINA_CHECK_STATIC([fixed-bitmap], [fixed bitmap])
# 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"])
EFL_CHECK_BENCHMARK([enable_benchmark="yes"], [enable_benchmark="no"])
### Checks for libraries
PKG_PROG_PKG_CONFIG
@ -141,22 +99,10 @@ case "$host_os" in
;;
esac
# Check library for unit tests
if test "x${enable_tests}" = "xyes" ; then
PKG_CHECK_MODULES([CHECK],
[check >= 0.9.5],
[dummy="yes"],
[enable_tests="no"]
)
fi
AM_CONDITIONAL(EINA_ENABLE_TESTS, test "x${enable_tests}" = "xyes")
# Glib library for comparison in the benchmark
have_glib="no"
if test "x${enable_bench}" = "xyes" ; then
if test "x${enable_benchmark}" = "xyes" ; then
PKG_CHECK_MODULES([GLIB],
[glib-2.0],
[have_glib="yes"],
@ -169,7 +115,7 @@ AM_CONDITIONAL(EINA_HAVE_GLIB, test "x${have_glib}" = "xyes")
# Evas library for comparison in the benchmark
have_evas="no"
if test "x${enable_bench}" = "xyes" ; then
if test "x${enable_benchmark}" = "xyes" ; then
PKG_CHECK_MODULES([EVAS],
[evas],
[have_evas="yes"],
@ -182,7 +128,7 @@ AM_CONDITIONAL(EINA_HAVE_EVAS, test "x${have_evas}" = "xyes")
# Ecore library for comparison in the benchmark
have_ecore="no"
if test "x${enable_bench}" = "xyes" ; then
if test "x${enable_benchmark}" = "xyes" ; then
PKG_CHECK_MODULES([ECORE],
[ecore],
[have_ecore="yes"],
@ -193,21 +139,21 @@ fi
AM_CONDITIONAL(EINA_HAVE_ECORE, test "x${have_ecore}" = "xyes")
# Check if we want to benchmark on real data
enable_bench_e17="no"
enable_benchmark_e17="no"
AC_ARG_ENABLE([benchmark-e17],
[AC_HELP_STRING([--enable-benchmark-e17], [disable heavy benchmark @<:@default=no@:>@])],
[
if test "x${enableval}" = "xyes" ; then
enable_bench_e17="yes"
enable_benchmark_e17="yes"
else
enable_bench_e17="no"
enable_benchmark_e17="no"
fi
],
[enable_bench_e17="no"]
[enable_benchmark_e17="no"]
)
AC_MSG_CHECKING([whether e17 real data benchmark are built])
AC_MSG_RESULT([${enable_bench_e17}])
AM_CONDITIONAL(EINA_ENABLE_BENCH_E17, test "x${enable_bench_e17}" = "xyes")
AC_MSG_RESULT([${enable_benchmark_e17}])
AM_CONDITIONAL(EINA_ENABLE_BENCHMARK_E17, test "x${enable_benchmark_e17}" = "xyes")
# Check ememoa memory pool library
@ -233,30 +179,6 @@ AC_HEADER_TIME
### Checks for programs
AC_PROG_CC
# lcov program for coverage report
if test "x$enable_tests" = "xno" -a "x$enable_coverage" = "xyes" ; then
AC_MSG_WARN([Coverage report requested but tests not being built. Run configure with --enable-tests])
enable_coverage="no"
fi
if test "x$enable_coverage" = "xyes" ; then
AC_CHECK_PROG(have_lcov, [lcov], [yes], [no])
if test "x$have_lcov" = "xyes" ; then
COVERAGE_CFLAGS="-fprofile-arcs -ftest-coverage"
COVERAGE_LIBS="-lgcov"
# remove any optimisation flag and force debug symbols
DEBUG_CFLAGS="-g -O0 -DDEBUG"
else
AC_MSG_WARN([lcov is not found, disable profiling instrumentation])
enable_coverage="no"
fi
fi
AC_SUBST(COVERAGE_CFLAGS)
AC_SUBST(COVERAGE_LIBS)
AM_CONDITIONAL(EINA_ENABLE_COVERAGE, test "x${enable_coverage}" = "xyes")
# doxygen program for documentation building
EFL_CHECK_DOXYGEN([build_doc="yes"], [build_doc="no"])
@ -276,7 +198,7 @@ AC_C_BIGENDIAN
AC_PROG_CC_STDC
AC_C___ATTRIBUTE__
EINA_CFLAGS="${COVERAGE_CFLAGS}"
EINA_CFLAGS="${EFL_COVERAGE_CFLAGS}"
case "${host_os}" in
cegcc*)
EINA_CFLAGS="${EINA_CFLAGS} ${EVIL_CFLAGS} -mwin32"
@ -287,7 +209,7 @@ case "${host_os}" in
esac
if test "x$enable_coverage" = "xyes" ; then
EINA_CFLAGS="${EINA_CFLAGS} ${DEBUG_CFLAGS}"
EINA_CFLAGS="${EINA_CFLAGS} ${EFL_DEBUG_CFLAGS}"
fi
if ! test "${VMIC}" = "x" ; then
@ -307,7 +229,7 @@ case "${host_os}" in
lt_enable_auto_import="-Wl,--enable-auto-import"
;;
*)
EINA_LIBS="${COVERAGE_LIBS} -ldl -lrt -lm"
EINA_LIBS="${EFL_COVERAGE_LIBS} -ldl -lrt -lm"
;;
esac
AC_SUBST(EINA_LIBS)
@ -373,12 +295,12 @@ echo
echo " Documentation........: ${build_doc}"
echo " Tests................: ${enable_tests}"
echo " Coverage.............: ${enable_coverage}"
echo " Bench................: ${enable_bench}"
if test "x${enable_bench}" = "xyes" ; then
echo " Benchmark............: ${enable_benchmark}"
if test "x${enable_benchmark}" = "xyes" ; then
echo " Glib...............: ${have_glib}"
echo " Evas...............: ${have_evas}"
echo " Ecore..............: ${have_ecore}"
echo " E17 real data......: ${enable_bench_e17}"
echo " E17 real data......: ${enable_benchmark_e17}"
fi
echo " Magic debug..........: ${enable_magic_debug}"
echo

View File

@ -0,0 +1,35 @@
dnl Copyright (C) 2008 Vincent Torri <vtorri at univ-evry dot fr>
dnl That code is public domain and can be freely used or copied.
dnl Macro that check if benchmark support is wanted.
dnl Usage: EFL_CHECK_BENCHMARK([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
dnl Defines the automake conditionnal EFL_ENABLE_BENCHMARK
AC_DEFUN([EFL_CHECK_BENCHMARK],
[
dnl configure option
AC_ARG_ENABLE([benchmark],
[AC_HELP_STRING([--enable-benchmark], [enable tests @<:@default=no@:>@])],
[
if test "x${enableval}" = "xyes" ; then
_eina_enable_benchmark="yes"
else
_eina_enable_benchmark="no"
fi
],
[_eina_enable_benchmark="no"]
)
AC_MSG_CHECKING([whether benchmark are built])
AC_MSG_RESULT([${_eina_enable_benchmark}])
AM_CONDITIONAL(EFL_ENABLE_BENCHMARK, test "x${_eina_enable_benchmark}" = "xyes")
if test "x${_eina_enable_benchmark}" = "xyes" ; then
ifelse([$1], , :, [$1])
else
ifelse([$2], , :, [$2])
fi
])

View File

@ -0,0 +1,64 @@
dnl Copyright (C) 2008 Vincent Torri <vtorri at univ-evry dot fr>
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], [compile with coverage profiling instrumentation @<:@default=no@:>@])],
[
if test "x${enableval}" = "xyes" ; then
_eina_enable_coverage="yes"
else
_eina_enable_coverage="no"
fi
],
[_eina_enable_coverage="no"]
)
AC_MSG_CHECKING([whether to use profiling instrumentation])
AC_MSG_RESULT([$_eina_enable_coverage])
dnl lcov check
if test ! "x$1" = "xyes" -a "x$_eina_enable_coverage" = "xyes" ; then
AC_MSG_WARN([Coverage report requested but tests not being built, disable profiling instrumentation.])
AC_MSG_WARN([Run configure with --enable-tests])
_eina_enable_coverage="no"
fi
if test "x$_eina_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])
_eina_enable_coverage="no"
fi
fi
dnl Substitution
AC_SUBST(EFL_COVERAGE_CFLAGS)
AC_SUBST(EFL_COVERAGE_LIBS)
AM_CONDITIONAL(EFL_ENABLE_COVERAGE, test "x${_eina_enable_coverage}" = "xyes")
if test "x${_eina_enable_coverage}" = "xyes" ; then
ifelse([$2], , :, [$2])
else
ifelse([$3], , :, [$3])
fi
])

View File

@ -0,0 +1,44 @@
dnl Copyright (C) 2008 Vincent Torri <vtorri at univ-evry dot fr>
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 Usage: EFL_CHECK_TESTS([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
dnl Define the automake conditionnal EFL_ENABLE_TESTS
AC_DEFUN([EFL_CHECK_TESTS],
[
dnl configure option
AC_ARG_ENABLE([tests],
[AC_HELP_STRING([--enable-tests], [enable tests @<:@default=no@:>@])],
[
if test "x${enableval}" = "xyes" ; then
_eina_enable_tests="yes"
else
_eina_enable_tests="no"
fi
],
[_eina_enable_tests="no"]
)
AC_MSG_CHECKING([whether tests are built])
AC_MSG_RESULT([${_eina_enable_tests}])
if test "x${_eina_enable_tests}" = "xyes" ; then
PKG_CHECK_MODULES([CHECK],
[check >= 0.9.5],
[dummy="yes"],
[_eina_enable_tests="no"]
)
fi
AM_CONDITIONAL(EFL_ENABLE_TESTS, test "x${_eina_enable_tests}" = "xyes")
if test "x${_eina_enable_tests}" = "xyes" ; then
ifelse([$1], , :, [$1])
else
ifelse([$2], , :, [$2])
fi
])

View File

@ -4,7 +4,7 @@ MAINTAINERCLEANFILES = Makefile.in
.PHONY: benchmark
if EINA_ENABLE_BENCH
if EFL_ENABLE_BENCHMARK
benchmark: all
make -C tests eina_bench
@ -12,6 +12,6 @@ benchmark: all
else
benchmark:
@echo "reconfigure with --enable-bench"
@echo "reconfigure with --enable-benchmark"
endif

View File

@ -3,7 +3,7 @@ MAINTAINERCLEANFILES = Makefile.in
AM_CPPFLAGS = \
-I. \
-I$(top_srcdir)/src/include \
@COVERAGE_CFLAGS@
@EINA_CFLAGS@
if !EINA_STATIC_BUILD_CHAINED_POOL
@ -13,7 +13,7 @@ controller_LTLIBRARIES = eina_chained_mempool.la
eina_chained_mempool_la_SOURCES = \
eina_chained_mempool.c
eina_chained_mempool_la_LIBADD = $(top_builddir)/src/lib/libeina.la @COVERAGE_LIBS@
eina_chained_mempool_la_LIBADD = $(top_builddir)/src/lib/libeina.la @EINA_LIBS@
eina_chained_mempool_la_LDFLAGS = -no-undefined @lt_enable_auto_import@ -module -avoid-version
eina_chained_mempool_la_LIBTOOLFLAGS = --tag=disable-static
eina_chained_mempool_la_DEPENDENCIES = $(top_builddir)/src/lib/libeina.la

View File

@ -4,7 +4,7 @@ Makefile.in
AM_CPPFLAGS = \
-I. \
-I$(top_srcdir)/src/include \
@COVERAGE_CFLAGS@ \
@EINA_CFLAGS@ \
@EMEMOA_CFLAGS@
if EINA_ENABLE_EMEMOA
@ -17,7 +17,7 @@ controller_LTLIBRARIES = eina_ememoa_fixed.la
eina_ememoa_fixed_la_SOURCES = \
eina_ememoa_fixed.c
eina_ememoa_fixed_la_LIBADD = $(top_builddir)/src/lib/libeina.la @EMEMOA_LIBS@ @COVERAGE_LIBS@
eina_ememoa_fixed_la_LIBADD = $(top_builddir)/src/lib/libeina.la @EINA_LIBS@ @EMEMOA_LIBS@
eina_ememoa_fixed_la_LDFLAGS = -no-undefined @lt_enable_auto_import@ -module -avoid-version
eina_ememoa_fixed_la_LIBTOOLFLAGS = --tag=disable-static
eina_ememoa_fixed_la_DEPENDENCIES = $(top_builddir)/src/lib/libeina.la

View File

@ -4,7 +4,7 @@ Makefile.in
AM_CPPFLAGS = \
-I. \
-I$(top_srcdir)/src/include \
@COVERAGE_CFLAGS@ \
@EINA_CFLAGS@ \
@EMEMOA_CFLAGS@
if EINA_ENABLE_EMEMOA
@ -17,7 +17,7 @@ controller_LTLIBRARIES = eina_ememoa_unknown.la
eina_ememoa_unknown_la_SOURCES = \
eina_ememoa_unknown.c
eina_ememoa_unknown_la_LIBADD = $(top_builddir)/src/lib/libeina.la @EMEMOA_LIBS@ @COVERAGE_LIBS@
eina_ememoa_unknown_la_LIBADD = $(top_builddir)/src/lib/libeina.la @EMEMOA_LIBS@ @EINA_LIBS@
eina_ememoa_unknown_la_LDFLAGS = -no-undefined @lt_enable_auto_import@ -module -avoid-version
eina_ememoa_unknown_la_LIBTOOLFLAGS = --tag=disable-static
eina_ememoa_unknown_la_DEPENDENCIES = $(top_builddir)/src/lib/libeina.la

View File

@ -3,7 +3,7 @@ MAINTAINERCLEANFILES = Makefile.in
AM_CPPFLAGS = \
-I. \
-I$(top_srcdir)/src/include \
@COVERAGE_CFLAGS@
@EINA_CFLAGS@
if !EINA_STATIC_BUILD_FIXED_BITMAP
@ -13,7 +13,7 @@ controller_LTLIBRARIES = eina_fixed_bitmap.la
eina_fixed_bitmap_la_SOURCES = \
eina_fixed_bitmap.c
eina_fixed_bitmap_la_LIBADD = $(top_builddir)/src/lib/libeina.la @COVERAGE_LIBS@
eina_fixed_bitmap_la_LIBADD = $(top_builddir)/src/lib/libeina.la @EINA_LIBS@
eina_fixed_bitmap_la_LDFLAGS = -no-undefined @lt_enable_auto_import@ -module -avoid-version
eina_fixed_bitmap_la_LIBTOOLFLAGS = --tag=disable-static
eina_fixed_bitmap_la_DEPENDENCIES = $(top_builddir)/src/lib/libeina.la

View File

@ -4,8 +4,7 @@ Makefile.in
AM_CPPFLAGS = \
-I. \
-I$(top_srcdir)/src/include \
@COVERAGE_CFLAGS@ \
@EMEMOA_CFLAGS@
@EINA_CFLAGS@
if !EINA_STATIC_BUILD_PASS_THROUGH
@ -15,7 +14,7 @@ controller_LTLIBRARIES = pass_through.la
pass_through_la_SOURCES = \
pass_through.c
pass_through_la_LIBADD = $(top_builddir)/src/lib/libeina.la @COVERAGE_LIBS@
pass_through_la_LIBADD = $(top_builddir)/src/lib/libeina.la @EINA_LIBS@
pass_through_la_LDFLAGS = -no-undefined @lt_enable_auto_import@ -module -avoid-version
pass_through_la_LIBTOOLFLAGS = --tag=disable-static
pass_through_la_DEPENDENCIES = $(top_builddir)/src/lib/libeina.la

View File

@ -32,13 +32,13 @@ AM_CPPFLAGS += -DEINA_BENCH_HAVE_ECORE
endif
if EINA_ENABLE_BENCH_E17
if EINA_ENABLE_BENCHMARK_E17
AM_CPPFLAGS += -DEINA_ENABLE_BENCH_E17
endif
if EINA_ENABLE_TESTS
if EFL_ENABLE_TESTS
check_PROGRAMS = eina_suite
@ -71,14 +71,14 @@ module_dummy_LTLIBRARIES = module_dummy.la
module_dummy_la_SOURCES = \
eina_test_module_dummy.c
module_dummy_la_LIBADD = $(top_builddir)/src/lib/libeina.la @COVERAGE_LIBS@
module_dummy_la_LIBADD = $(top_builddir)/src/lib/libeina.la @EINA_LIBS@
module_dummy_la_LDFLAGS = -no-undefined @lt_enable_auto_import@ -module -avoid-version
module_dummy_la_LIBTOOLFLAGS = --tag=disable-static
module_dummy_la_DEPENDENCIES = $(top_builddir)/src/lib/libeina.la
endif
if EINA_ENABLE_BENCH
if EFL_ENABLE_BENCHMARK
bench_PROGRAMS = eina_bench