summaryrefslogtreecommitdiff
path: root/m4/efl_tests.m4
diff options
context:
space:
mode:
authorVincent Torri <vincent.torri@gmail.com>2012-09-16 10:57:48 +0000
committerVincent Torri <vincent.torri@gmail.com>2012-09-16 10:57:48 +0000
commit785f2a6b3a70454ecfe94addc6480ebf20c44c13 (patch)
tree17a195d2c1f022cd480fd0e0b95be5035ad915e2 /m4/efl_tests.m4
parentdfc0331373c3f98df7cb996abc588c7dcf44af0a (diff)
merge : add eina
currently, examples, tests and benchmark are not set. That's the next things i'll do SVN revision: 76710
Diffstat (limited to '')
-rw-r--r--m4/efl_tests.m449
1 files changed, 49 insertions, 0 deletions
diff --git a/m4/efl_tests.m4 b/m4/efl_tests.m4
new file mode 100644
index 0000000000..612baa0e8e
--- /dev/null
+++ b/m4/efl_tests.m4
@@ -0,0 +1,49 @@
1dnl Copyright (C) 2008-2012 Vincent Torri <vtorri at univ-evry dot fr>
2dnl That code is public domain and can be freely used or copied.
3
4dnl Macro that check if tests programs are wanted and if yes, if
5dnl the Check library is available.
6dnl the lcov program is available.
7
8dnl Usage: EFL_CHECK_TESTS(EFL[, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
9dnl Define the automake conditionnal EFL_ENABLE_TESTS
10
11AC_DEFUN([EFL_CHECK_TESTS],
12[
13m4_pushdef([UPEFL], m4_translit([$1], [-a-z], [_A-Z]))dnl
14
15dnl configure option
16
17AC_REQUIRE([PKG_PROG_PKG_CONFIG])
18
19PKG_CHECK_MODULES([CHECK],
20 [check >= 0.9.5],
21 [_efl_enable_tests="yes"],
22 [_efl_enable_tests="no"])
23
24AM_CONDITIONAL([EFL_ENABLE_TESTS], [test "x${_efl_enable_tests}" = "xyes"])
25
26_efl_enable_coverage="no"
27AC_CHECK_PROG(have_lcov, [lcov], [yes], [no])
28if test "x$have_lcov" = "xyes" ; then
29 m4_defn([UPEFL])[]_CFLAGS="${m4_defn([UPEFL])[]_CFLAGS} -fprofile-arcs -ftest-coverage"
30 m4_defn([UPEFL])[]_LIBS="${m4_defn([UPEFL])[]_LIBS} -lgcov"
31# remove any optimisation flag and force debug symbols
32 if test "x${prefer_assert}" = "xno"; then
33 m4_defn([UPEFL])[]_CFLAGS="${m4_defn([UPEFL])[]_CFLAGS} -DNDEBUG"
34 else
35 m4_defn([UPEFL])[]_CFLAGS="${m4_defn([UPEFL])[]_CFLAGS} -g -O0 -DDEBUG"
36 fi
37 _efl_enable_coverage="yes"
38else
39 AC_MSG_WARN([lcov is not found, disable profiling instrumentation])
40fi
41
42AM_CONDITIONAL([EFL_ENABLE_COVERAGE], [test "x${_efl_enable_coverage}" = "xyes"])
43
44AS_IF([test "x$_efl_enable_tests" = "xyes"], [$2], [$3])
45
46m4_popdef([UPEFL])
47])
48
49dnl End of efl_tests.m4