Commit 332c8f0b authored by W. Michael Petullo's avatar W. Michael Petullo

Backport from 4.0 series: adjust how building tests works

Previously, the presence of the check library led to libdmapsharing
building its unit tests and supporting facilities, despite the separate
configure flag --disable-tests. This led to confusion as to whether some
test facilities should be present in the compiled libdmapsharing. Now,
--disable-tests disables all tests, whether unit tests or sample programs,
and it ensure not test facilities exist in libdmapsharing.
parent 9aaed0a0
......@@ -93,6 +93,9 @@
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
/* Defined when tests are to be built */
#undef TESTS_ENABLED
/* Version number of package */
#undef VERSION
......@@ -104,6 +107,3 @@
/* Define if mDNS/DNS-SD implementation uses Howl */
#undef WITH_HOWL
/* Defined when tests are to be built */
#undef WITH_TESTS
......@@ -69,10 +69,19 @@ AC_CONFIG_MACRO_DIR(m4)
dnl Test if --disable-tests given
AC_ARG_ENABLE(tests, [AC_HELP_STRING([--disable-tests],[do not build tests])], tests=$enableval, tests=yes)
if test x$tests = xyes; then
AC_DEFINE(WITH_TESTS,1,[Defined when tests are to be built])
AM_CONDITIONAL(WITH_TESTS, true)
PKG_CHECK_MODULES([CHECK], [check >= 0.9.4],have_check=yes,have_check=no)
AM_CONDITIONAL(HAVE_CHECK, test x"$have_check" = "xyes")
if test "x$have_check" = "xyes"; then
AC_DEFINE(HAVE_CHECK, 1, [Define if check support is enabled])
else
AC_MSG_ERROR([Must have check library present when tests enabled])
fi
AC_DEFINE(TESTS_ENABLED,1,[Defined when tests are to be built])
AM_CONDITIONAL(TESTS_ENABLED, true)
else
AM_CONDITIONAL(WITH_TESTS, false)
AM_CONDITIONAL(TESTS_ENABLED, false)
AM_CONDITIONAL(HAVE_CHECK, false)
fi
dnl Now check required packages
......@@ -363,17 +372,6 @@ if test -n "$BUILD_DPAPVIEW" ; then
AC_WARN([will not build dpapview])
fi
AC_ARG_ENABLE(check, [ --disable-check do not build check support], enable_check=$enableval, enable_check=yes)
if test x$enable_check = xyes; then
PKG_CHECK_MODULES([CHECK], [check >= 0.9.4],have_check=yes,have_check=no)
AM_CONDITIONAL(HAVE_CHECK, test x"$have_check" = "xyes")
if test "x$have_check" = "xyes"; then
AC_DEFINE(HAVE_CHECK, 1, [Define if check support is enabled])
fi
else
AM_CONDITIONAL(HAVE_CHECK, false)
fi
AC_CHECK_LIB(z, uncompress)
dnl common/m4/dmap-arch.m4
......
......@@ -24,7 +24,7 @@ libdmapsharing_3_0_la_SOURCES = \
dpap-record.c \
dpap-share.c
if HAVE_CHECK
if TESTS_ENABLED
libdmapsharing_3_0_la_SOURCES += \
test-daap-record.c \
test-daap-record-factory.c \
......
if WITH_TESTS
if TESTS_ENABLED
noinst_PROGRAMS = test-dmap-client test-dmap-server
if HAVE_GEE
......@@ -45,7 +45,7 @@ test_dmap_server_LDADD = \
$(MDNS_LIBS)
if HAVE_VALAC
if WITH_TESTS
if TESTS_ENABLED
BUILT_SOURCES = dacplisten.stamp dpapview.stamp dmapcopy.stamp dmapserve.stamp
endif
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment