## 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
+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_names_SOURCES= \
+ test-names.c
+
+test_names_LDADD=$(top_builddir)/dbus/libdbus-convenience.la $(DBUS_TEST_LIBS)
+test_names_LDFLAGS=@R_DYNAMIC_LDFLAG@
AM_CPPFLAGS = -DDBUS_STATIC_BUILD
test_pending_call_dispatch_SOURCES = \
test_privserver_client_LDADD=$(top_builddir)/dbus/libdbus-internal.la ../libdbus-testutils.la $(DBUS_TEST_LIBS)
test_privserver_client_LDFLAGS=@R_DYNAMIC_LDFLAG@
+test_autolaunch_SOURCES = \
+ test-autolaunch.c
+
+test_autolaunch_CFLAGS=
+test_autolaunch_LDADD=$(top_builddir)/dbus/libdbus-internal.la ../libdbus-testutils.la $(DBUS_TEST_LIBS)
+test_autolaunch_LDFLAGS=@R_DYNAMIC_LDFLAG@
+
endif
echo "Failed test-activation-forking"
exit 1
fi
+
+echo "running test-autolaunch"
+${DBUS_TOP_BUILDDIR}/libtool --mode=execute $DEBUG $DBUS_TOP_BUILDDIR/test/name-test/test-autolaunch || die "test-autolaunch failed"
--- /dev/null
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+#include <dbus/dbus.h>
+#include "dbus/dbus-sysdeps.h"
+
+int
+main (int argc, char *argv[])
+{
+ DBusConnection *conn = NULL;
+ DBusError error;
+
+ _dbus_setenv ("DBUS_SESSION_BUS_ADDRESS", NULL);
+
+ dbus_error_init (&error);
+
+ conn = dbus_bus_get (DBUS_BUS_SESSION, &error);
+ if (dbus_error_is_set (&error))
+ {
+ fprintf (stderr, "*** Failed to autolaunch session bus: %s\n",
+ error.message);
+ dbus_error_free (&error);
+ return 1;
+ }
+
+ return 0;
+}