Ticket #2501: 'lib' should be independ to 'src' directory

Added base support for unit tests (see http://check.sourceforge.net/ for details).

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
This commit is contained in:
Slava Zanko 2011-02-15 12:42:51 +02:00
parent b67d0c0b92
commit fc7142d2a0
3 changed files with 28 additions and 0 deletions

View File

@ -9,3 +9,4 @@ m4_include([m4.include/mc-with-screen.m4])
m4_include([m4.include/ac-g-module-supported.m4])
m4_include([m4.include/mc-vfs.m4])
m4_include([m4.include/mc-version.m4])
m4_include([m4.include/mc-tests.m4])

View File

@ -489,6 +489,8 @@ if test "x$enable_werror" = xyes; then
fi
CFLAGS="$mc_configured_cflags $CFLAGS_OPTS $CFLAGS"
MC_UNIT_TESTS
AC_SUBST(CFLAGS)
AC_SUBST(CPPFLAGS)
AC_SUBST(LDFLAGS)

25
m4.include/mc-tests.m4 Normal file
View File

@ -0,0 +1,25 @@
dnl @synopsis MC_UNIT_TESTS
dnl
dnl Check if unit tests enabled
dnl
dnl @author Slava Zanko <slavazanko@gmail.com>
dnl @version 2011-02-10
dnl @license GPL
dnl @copyright Free Software Foundation, Inc.
AC_DEFUN([MC_UNIT_TESTS],[
AC_ARG_ENABLE(
[tests],
AC_HELP_STRING([--enable-tests], [Enable unit tests (see http://check.sourceforge.net/)] )
)
if test x$enable_tests != xno; then
PKG_CHECK_MODULES(
CHECK,
[check >= 0.9.0],
[have_check=yes],
[AC_MSG_WARN(['Check' utility not found. Check your environment])])
fi
AM_CONDITIONAL(HAVE_TESTS, test x"$have_check" = "xyes")
])