diff options
author | Olliver Schinagl <oliver@schinagl.nl> | 2016-02-05 10:36:22 (GMT) |
---|---|---|
committer | Olliver Schinagl <oliver@schinagl.nl> | 2016-03-10 09:37:39 (GMT) |
commit | 660f1a8cc94f7176f49d5021e7b979030c5ac42e (patch) | |
tree | 9de61b286e8bb59dd9f74280082c3dcac14b8585 /m4/efl_tests.m4 | |
parent | 398af5331bacd2e2aa4914e9926bf32d28cf8c14 (diff) | |
download | engagement-660f1a8cc94f7176f49d5021e7b979030c5ac42e.zip engagement-660f1a8cc94f7176f49d5021e7b979030c5ac42e.tar.gz engagement-660f1a8cc94f7176f49d5021e7b979030c5ac42e.tar.bz2 |
Add empty eflprj generated skeleton project
Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
Diffstat (limited to 'm4/efl_tests.m4')
-rw-r--r-- | m4/efl_tests.m4 | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/m4/efl_tests.m4 b/m4/efl_tests.m4 new file mode 100644 index 0000000..d6b1bc5 --- /dev/null +++ b/m4/efl_tests.m4 @@ -0,0 +1,65 @@ +dnl Copyright (C) 2013 Cedric BAIL <cedric.bail at free dot fr> +dnl That code is public domain and can be freely used or copied. + +dnl Macro for checking availability of tests and coverage infra structure + +dnl Usage: EFL_TESTS(profile) +dnl Valid profile are auto, tests, coverage, no +dnl Call PKG_CHECK_MODULES, AC_CHECK_PROG, define CHECK_CFLAGS/CHECK_LIBS and modify CFLAGS/LIBS +dnl It define EFL_HAVE_TESTS/EFL_HAVE_LCOV for use in Makefile.am +dnl It set have_test and have_coverage to yes/no depending if found + +AC_DEFUN([EFL_TESTS], +[ +build_tests=$1 + +case "${build_tests}" in + auto) + check_tests="auto" + check_coverage="auto" + ;; + tests) + check_tests="yes" + check_coverage="auto" + ;; + coverage) + check_tests="yes" + check_coverage="yes" + ;; + no) + check_tests="no" + check_coverage="no" + ;; + *) + AC_MSG_ERROR([Unknow tests profile]) +esac + +have_tests="no" +if test "x${check_tests}" = "xyes" -o "x${check_tests}" = "xauto"; then + PKG_CHECK_MODULES([CHECK], [check >= 0.9.5], [have_tests="yes"], [have_tests="no"]) + if test "${check_tests}" = "xyes" -a "x${have_tests}" = "xno"; then + AC_MSG_ERROR([Impossible to find check package to build tests]) + fi +fi + +if test "x${have_tests}" = "xyes"; then + if test "x${check_coverage}" = "xyes" -o "x${check_coverage}" = "xauto"; then + AC_CHECK_PROG([have_lcov], [lcov], [yes], [no]) + if test "x${have_lcov}" = "xyes" ; then + CFLAGS="${CFLAGS} -fprofile-arcs -ftest-coverage" + LIBS="${LIBS} -lgcov" + fi + if test "x${have_lcov}" = "xno" -a "x${check_coverage}" = "xyes"; then + AC_MSG_ERROR([Impossible to find lcov package to build with coverage support]) + fi + else + have_coverage="no" + fi +else + have_coverage="no" +fi + +AM_CONDITIONAL([EFL_HAVE_TESTS], [test "x${have_tests}" = "xyes"]) +AM_CONDITIONAL([EFL_HAVE_LCOV], [test "x${have_lcov}" = "xyes"]) + +]) |