mirror of https://github.com/nirenjan/libx52.git
Disable cmocka tests on non-Linux hosts
parent
3afe999fe8
commit
e9167b4c20
16
configure.ac
16
configure.ac
|
@ -17,6 +17,17 @@ LT_INIT
|
||||||
PKG_PROG_PKG_CONFIG
|
PKG_PROG_PKG_CONFIG
|
||||||
PKG_INSTALLDIR
|
PKG_INSTALLDIR
|
||||||
AX_COMPILER_FLAGS
|
AX_COMPILER_FLAGS
|
||||||
|
AC_CANONICAL_HOST
|
||||||
|
|
||||||
|
AC_MSG_NOTICE([Detected host OS is ${host_os}])
|
||||||
|
build_linux=no
|
||||||
|
# Detect target system
|
||||||
|
case "${host_os}" in
|
||||||
|
linux*)
|
||||||
|
build_linux=yes
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
AM_CONDITIONAL([LINUX], [test "x${build_linux}" = "xyes"])
|
||||||
|
|
||||||
# Internationalization
|
# Internationalization
|
||||||
AM_GNU_GETTEXT([external])
|
AM_GNU_GETTEXT([external])
|
||||||
|
@ -62,10 +73,11 @@ AM_COND_IF([HAVE_DOXYGEN],
|
||||||
[AC_CONFIG_FILES([Doxyfile])],
|
[AC_CONFIG_FILES([Doxyfile])],
|
||||||
[AC_MSG_WARN(["Doxygen not found; continuing without doxygen support"])])
|
[AC_MSG_WARN(["Doxygen not found; continuing without doxygen support"])])
|
||||||
|
|
||||||
# cmocka unit tests
|
# cmocka unit tests, currently only supported on Linux
|
||||||
AX_PKG_CHECK_MODULES([CMOCKA], [cmocka], [], [have_cmocka=yes], [have_cmocka=no])
|
AX_PKG_CHECK_MODULES([CMOCKA], [cmocka], [], [have_cmocka=yes], [have_cmocka=no])
|
||||||
AM_CONDITIONAL([HAVE_CMOCKA], [test "x$have_cmocka" = xyes])
|
AM_CONDITIONAL([HAVE_CMOCKA], [test "x$have_cmocka" = xyes])
|
||||||
AM_COND_IF([HAVE_CMOCKA], [],
|
AM_COND_IF([HAVE_CMOCKA], [AM_COND_IF([LINUX], [],
|
||||||
|
[AC_MSG_WARN(["cmocka found, but cannot build on ${host_os}])])],
|
||||||
[AC_MSG_WARN(["cmocka not found; disabling unit test build"])])
|
[AC_MSG_WARN(["cmocka not found; disabling unit test build"])])
|
||||||
|
|
||||||
# Check for the presence of tm_gmtoff in struct tm. If we have this, then we
|
# Check for the presence of tm_gmtoff in struct tm. If we have this, then we
|
||||||
|
|
|
@ -31,6 +31,7 @@ x52include_HEADERS = libx52.h
|
||||||
# pkg-config files
|
# pkg-config files
|
||||||
pkgconfig_DATA = libx52.pc
|
pkgconfig_DATA = libx52.pc
|
||||||
|
|
||||||
|
if LINUX
|
||||||
if HAVE_CMOCKA
|
if HAVE_CMOCKA
|
||||||
LOG_DRIVER = env AM_TAP_AWK='$(AWK)' $(SHELL) $(top_srcdir)/tap-driver.sh
|
LOG_DRIVER = env AM_TAP_AWK='$(AWK)' $(SHELL) $(top_srcdir)/tap-driver.sh
|
||||||
TESTS = libx52test
|
TESTS = libx52test
|
||||||
|
@ -47,6 +48,7 @@ CLEANFILES = test_libx52.c
|
||||||
test_libx52.c: $(srcdir)/x52_test_gen.py $(srcdir)/x52_tests.json
|
test_libx52.c: $(srcdir)/x52_test_gen.py $(srcdir)/x52_tests.json
|
||||||
$(AM_V_GEN) $(PYTHON) $(srcdir)/x52_test_gen.py $(srcdir)/x52_tests.json > $@
|
$(AM_V_GEN) $(PYTHON) $(srcdir)/x52_test_gen.py $(srcdir)/x52_tests.json > $@
|
||||||
endif
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
# Extra files that need to be in the distribution
|
# Extra files that need to be in the distribution
|
||||||
EXTRA_DIST = libx52.h x52_commands.h x52_common.h README.md
|
EXTRA_DIST = libx52.h x52_commands.h x52_common.h README.md
|
||||||
|
|
Loading…
Reference in New Issue