2016-01-04 21:43:19 +03:00
|
|
|
dnl @synopsis mc_UNIT_TESTS
|
2011-02-15 13:42:51 +03:00
|
|
|
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.
|
|
|
|
|
2016-01-04 21:43:19 +03:00
|
|
|
AC_DEFUN([mc_UNIT_TESTS],[
|
2011-02-15 13:42:51 +03:00
|
|
|
|
|
|
|
AC_ARG_ENABLE(
|
|
|
|
[tests],
|
2016-10-31 19:03:41 +03:00
|
|
|
AS_HELP_STRING([--enable-tests], [Enable unit tests (see http://libcheck.github.io/check/) @<:@auto@:>@])
|
2011-02-15 13:42:51 +03:00
|
|
|
)
|
|
|
|
|
2016-10-31 19:03:41 +03:00
|
|
|
dnl 'tests_msg' holds the human-readable message to show in configure's summary text.
|
|
|
|
|
2019-02-23 10:21:08 +03:00
|
|
|
if test x"$enable_tests" = "xno"; then
|
2016-10-31 19:03:41 +03:00
|
|
|
dnl The user explicitly specified '--disable-tests'.
|
|
|
|
tests_msg="no"
|
|
|
|
else
|
2011-02-15 13:42:51 +03:00
|
|
|
PKG_CHECK_MODULES(
|
|
|
|
CHECK,
|
2022-02-20 17:49:12 +03:00
|
|
|
[check >= 0.9.10],
|
2016-10-31 19:03:41 +03:00
|
|
|
[
|
|
|
|
have_check=yes
|
|
|
|
tests_msg="yes"
|
|
|
|
],
|
|
|
|
[
|
|
|
|
AC_MSG_WARN(['Check' testing framework not found. Check your environment])
|
|
|
|
tests_msg="no ('Check' testing framework not found)"
|
|
|
|
|
|
|
|
dnl The following behavior, of "exit if feature requested but not found", is just a
|
|
|
|
dnl preference and can be safely removed.
|
2019-02-23 10:21:08 +03:00
|
|
|
if test x"$enable_tests" = "xyes"; then
|
2016-10-31 19:03:41 +03:00
|
|
|
AC_MSG_ERROR([You explicitly specified '--enable-tests', but this requirement cannot be met.])
|
|
|
|
fi
|
|
|
|
])
|
2015-02-23 16:22:37 +03:00
|
|
|
AC_SUBST(CHECK_CFLAGS)
|
|
|
|
AC_SUBST(CHECK_LIBS)
|
2011-02-15 13:42:51 +03:00
|
|
|
fi
|
|
|
|
AM_CONDITIONAL(HAVE_TESTS, test x"$have_check" = "xyes")
|
2024-07-28 19:50:55 +03:00
|
|
|
AS_IF([test x"$have_check" = "xyes"], [AC_DEFINE([HAVE_TESTS], [1], [Build with unit tests.])])
|
2012-10-19 14:14:57 +04:00
|
|
|
|
2019-02-22 11:32:43 +03:00
|
|
|
dnl sighandler_t is GNU extension
|
Fix various typos in the source code (closes MidnightCommander/mc#177).
Found via `codespell -S
po,doc,./misc/syntax,./src/vfs/extfs/helpers/README.it -L
parm,rouge,sav,ect,vie,te,dum,clen,wee,dynamc,childs,ths,fo,nin,unx,nd,iif,iterm,ser,makrs,wil`
Co-authored-by: Yury V. Zaytsev <yury@shurup.com>
Signed-off-by: Kian-Meng Ang <kianmeng@cpan.org>
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2023-01-10 06:02:52 +03:00
|
|
|
dnl AC_USE_SYSTEM_EXTENSIONS is required
|
2019-02-22 11:32:43 +03:00
|
|
|
AC_CHECK_TYPES([sighandler_t], [], [], [
|
|
|
|
#include <signal.h>
|
|
|
|
])
|
2011-02-15 13:42:51 +03:00
|
|
|
])
|