diff options
Diffstat (limited to '')
-rw-r--r-- | libraries/evas/m4/efl_tests.m4 | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/libraries/evas/m4/efl_tests.m4 b/libraries/evas/m4/efl_tests.m4 new file mode 100644 index 0000000..f044323 --- /dev/null +++ b/libraries/evas/m4/efl_tests.m4 | |||
@@ -0,0 +1,46 @@ | |||
1 | dnl Copyright (C) 2008 Vincent Torri <vtorri at univ-evry dot fr> | ||
2 | dnl That code is public domain and can be freely used or copied. | ||
3 | |||
4 | dnl Macro that check if tests programs are wanted and if yes, if | ||
5 | dnl the Check library is available. | ||
6 | |||
7 | dnl Usage: EFL_CHECK_TESTS([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) | ||
8 | dnl Define the automake conditionnal EFL_ENABLE_TESTS | ||
9 | |||
10 | AC_DEFUN([EFL_CHECK_TESTS], | ||
11 | [ | ||
12 | |||
13 | dnl configure option | ||
14 | |||
15 | AC_ARG_ENABLE([tests], | ||
16 | [AC_HELP_STRING([--enable-tests], [enable tests @<:@default=disabled@:>@])], | ||
17 | [ | ||
18 | if test "x${enableval}" = "xyes" ; then | ||
19 | _efl_enable_tests="yes" | ||
20 | else | ||
21 | _efl_enable_tests="no" | ||
22 | fi | ||
23 | ], | ||
24 | [_efl_enable_tests="no"]) | ||
25 | |||
26 | AC_MSG_CHECKING([whether tests are built]) | ||
27 | AC_MSG_RESULT([${_efl_enable_tests}]) | ||
28 | |||
29 | AC_REQUIRE([PKG_PROG_PKG_CONFIG]) | ||
30 | |||
31 | if test "x${_efl_enable_tests}" = "xyes" ; then | ||
32 | PKG_CHECK_MODULES([CHECK], | ||
33 | [check >= 0.9.5], | ||
34 | [dummy="yes"], | ||
35 | [_efl_enable_tests="no"]) | ||
36 | fi | ||
37 | if test "x${_efl_enable_tests}" = "xyes" ; then | ||
38 | AC_DEFINE(HAVE_TESTS, 1, [Set to 1 if we enabled unit testing.]) | ||
39 | fi | ||
40 | |||
41 | AM_CONDITIONAL(EFL_ENABLE_TESTS, test "x${_efl_enable_tests}" = "xyes") | ||
42 | |||
43 | AS_IF([test "x$_efl_enable_tests" = "xyes"], [$1], [$2]) | ||
44 | ]) | ||
45 | |||
46 | dnl End of efl_tests.m4 | ||