dbus/test/name-test/Makefile.am
Simon McVittie 30e7a81302 Tests: allow dbus-glib to be replaced with use of libdbus-internal
We only use dbus-glib for its main loop; within dbus, DBusLoop is
available as an alternative, although it isn't thread-safe and
isn't public API.

For tests that otherwise only use libdbus public API, it's desirable to
be able to avoid DBusLoop, so we can run them against an installed
libdbus as an integration test. However, if we don't have dbus-glib,
we're going to have to use an in-tree main loop, which might as well
be DBusLoop.

The major disadvantage of using dbus-glib is that it isn't safe to
link both dbus-1 and dbus-internal at the same time. This is awkward
for a future test case that wants to use _dbus_getsid() in dbus-daemon.c,
but only on Windows (fd.o #54445). If we use the same API wrapper around
both dbus-glib and DBusLoop, we can compile that test against dbus-glib
or against DBusLoop, depending on the platform.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=68852
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
2013-09-03 12:00:51 +01:00

40 lines
1.5 KiB
Makefile

# Everything in this directory is statically-linked to libdbus-internal
AM_CPPFLAGS = \
-I$(top_srcdir) \
-DDBUS_COMPILATION \
-DDBUS_STATIC_BUILD \
-DDBUS_TEST_USE_INTERNAL \
$(NULL)
# if assertions are enabled, improve backtraces
AM_LDFLAGS = @R_DYNAMIC_LDFLAG@
## note that TESTS has special meaning (stuff to use in make check)
## so if adding tests not to be run in make check, don't add them to
## TESTS
if DBUS_ENABLE_EMBEDDED_TESTS
TESTS_ENVIRONMENT=DBUS_TOP_BUILDDIR=@abs_top_builddir@ DBUS_TOP_SRCDIR=@abs_top_srcdir@ PYTHON=@PYTHON@
TESTS=run-test.sh run-test-systemserver.sh
else
TESTS=
endif
EXTRA_DIST=run-test.sh run-test-systemserver.sh test-wait-for-echo.py test-activation-forking.py
if DBUS_ENABLE_EMBEDDED_TESTS
## we use noinst_PROGRAMS not check_PROGRAMS for TESTS so that we
## build even when not doing "make check"
noinst_PROGRAMS=test-pending-call-dispatch test-pending-call-timeout test-threads-init test-ids test-shutdown test-privserver test-privserver-client test-autolaunch
test_pending_call_dispatch_LDADD=$(top_builddir)/dbus/libdbus-internal.la
test_pending_call_timeout_LDADD=$(top_builddir)/dbus/libdbus-internal.la
test_threads_init_LDADD=$(top_builddir)/dbus/libdbus-internal.la
test_ids_LDADD=$(top_builddir)/dbus/libdbus-internal.la
test_shutdown_LDADD=../libdbus-testutils-internal.la
test_privserver_LDADD=../libdbus-testutils-internal.la
test_privserver_client_LDADD=../libdbus-testutils-internal.la
test_autolaunch_LDADD=../libdbus-testutils-internal.la
endif