summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/CMakeLists.txt17
-rw-r--r--test/Makefile.am43
-rw-r--r--test/bus/failed-helper-activation.c37
-rw-r--r--test/bus/helper-activation.c (renamed from test/bus/dispatch.c)2
-rw-r--r--test/bus/normal-activation.c33
-rw-r--r--test/meson.build35
6 files changed, 148 insertions, 19 deletions
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index c08ad95b..8ea3bb52 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -150,9 +150,12 @@ if(DBUS_ENABLE_EMBEDDED_TESTS)
add_test_executable(test-bus "${SOURCES}" dbus-daemon-internal dbus-testutils ${EXPAT_LIBRARIES})
set_target_properties(test-bus PROPERTIES COMPILE_FLAGS ${DBUS_INTERNAL_CLIENT_DEFINITIONS})
- set(SOURCES bus/dispatch.c bus/common.c bus/common.h)
- add_test_executable(test-bus-dispatch "${SOURCES}" dbus-daemon-internal dbus-testutils ${EXPAT_LIBRARIES})
- set_target_properties(test-bus-dispatch PROPERTIES COMPILE_FLAGS ${DBUS_INTERNAL_CLIENT_DEFINITIONS})
+ if(ENABLE_TRADITIONAL_ACTIVATION)
+ set(SOURCES bus/normal-activation.c bus/common.c bus/common.h)
+ add_test_executable(test-bus-normal-activation "${SOURCES}" dbus-daemon-internal dbus-testutils ${EXPAT_LIBRARIES})
+ set_target_properties(test-bus-normal-activation PROPERTIES COMPILE_FLAGS ${DBUS_INTERNAL_CLIENT_DEFINITIONS})
+ endif()
+
set(SOURCES bus/dispatch-sha1.c bus/common.c bus/common.h)
add_test_executable(test-bus-dispatch-sha1 "${SOURCES}" dbus-daemon-internal dbus-testutils ${EXPAT_LIBRARIES})
@@ -163,6 +166,14 @@ if(DBUS_ENABLE_EMBEDDED_TESTS)
if(ENABLE_TRADITIONAL_ACTIVATION)
add_test_executable(test-bus-launch-helper-oom bus/launch-helper-oom.c launch-helper-internal dbus-testutils)
add_helper_executable(dbus-daemon-launch-helper-for-tests bus/launch-helper-for-tests.c launch-helper-internal)
+
+ set(SOURCES bus/failed-helper-activation.c bus/common.c bus/common.h)
+ add_test_executable(test-bus-failed-helper-activation "${SOURCES}" dbus-daemon-internal dbus-testutils ${EXPAT_LIBRARIES})
+ set_target_properties(test-bus-failed-helper-activation PROPERTIES COMPILE_FLAGS ${DBUS_INTERNAL_CLIENT_DEFINITIONS})
+
+ set(SOURCES bus/helper-activation.c bus/common.c bus/common.h)
+ add_test_executable(test-bus-helper-activation "${SOURCES}" dbus-daemon-internal dbus-testutils ${EXPAT_LIBRARIES})
+ set_target_properties(test-bus-helper-activation PROPERTIES COMPILE_FLAGS ${DBUS_INTERNAL_CLIENT_DEFINITIONS})
endif()
endif()
endif()
diff --git a/test/Makefile.am b/test/Makefile.am
index 18798278..f791a56e 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -87,16 +87,21 @@ endif
uninstallable_test_programs += \
test-platform-mutex \
test-bus \
- test-bus-dispatch \
test-bus-dispatch-sha1 \
test-marshal-recursive \
test-message-internals \
$(NULL)
+if ENABLE_TRADITIONAL_ACTIVATION
+uninstallable_test_programs += test-normal-activation
+endif
+
if DBUS_UNIX
if ENABLE_TRADITIONAL_ACTIVATION
uninstallable_test_programs += test-bus-launch-helper-oom
uninstallable_test_programs += test-bus-system
+uninstallable_test_programs += test-failed-helper-activation
+uninstallable_test_programs += test-helper-activation
# this is used by the tests but is not, itself, a test
TEST_BINARIES += dbus-daemon-launch-helper-for-tests
endif ENABLE_TRADITIONAL_ACTIVATION
@@ -205,12 +210,6 @@ test_bus_LDADD = \
libdbus-testutils.la \
$(NULL)
-test_bus_dispatch_SOURCES = bus/dispatch.c bus/common.c bus/common.h
-test_bus_dispatch_LDADD = \
- $(top_builddir)/bus/libdbus-daemon-internal.la \
- libdbus-testutils.la \
- $(NULL)
-
test_bus_dispatch_sha1_SOURCES = bus/dispatch-sha1.c bus/common.c bus/common.h
test_bus_dispatch_sha1_LDADD = \
$(top_builddir)/bus/libdbus-daemon-internal.la \
@@ -220,6 +219,26 @@ test_bus_dispatch_sha1_LDADD = \
test_hash_SOURCES = internals/hash.c
test_hash_LDADD = libdbus-testutils.la
+test_failed_helper_activation_SOURCES = \
+ bus/failed-helper-activation.c \
+ bus/common.c \
+ bus/common.h \
+ $(NULL)
+test_failed_helper_activation_LDADD = \
+ $(top_builddir)/bus/libdbus-daemon-internal.la \
+ libdbus-testutils.la \
+ $(NULL)
+
+test_helper_activation_SOURCES = \
+ bus/helper-activation.c \
+ bus/common.c \
+ bus/common.h \
+ $(NULL)
+test_helper_activation_LDADD = \
+ $(top_builddir)/bus/libdbus-daemon-internal.la \
+ libdbus-testutils.la \
+ $(NULL)
+
test_marshal_recursive_SOURCES = \
internals/dbus-marshal-recursive-util.c \
internals/dbus-marshal-recursive-util.h \
@@ -257,6 +276,16 @@ test_misc_internals_SOURCES = \
$(NULL)
test_misc_internals_LDADD = libdbus-testutils.la
+test_normal_activation_SOURCES = \
+ bus/normal-activation.c \
+ bus/common.c \
+ bus/common.h \
+ $(NULL)
+test_normal_activation_LDADD = \
+ $(top_builddir)/bus/libdbus-daemon-internal.la \
+ libdbus-testutils.la \
+ $(NULL)
+
test_platform_mutex_SOURCES = test-platform-mutex.c
test_platform_mutex_LDADD = \
$(top_builddir)/dbus/libdbus-internal.la \
diff --git a/test/bus/failed-helper-activation.c b/test/bus/failed-helper-activation.c
new file mode 100644
index 00000000..044ab42d
--- /dev/null
+++ b/test/bus/failed-helper-activation.c
@@ -0,0 +1,37 @@
+/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
+/*
+ * Copyright 2003-2009 Red Hat, Inc.
+ * Copyright 2011-2018 Collabora Ltd.
+ *
+ * Licensed under the Academic Free License version 2.1
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ */
+
+#include <config.h>
+#include "test/bus/common.h"
+
+static DBusTestCase test =
+{
+ "failed-helper-activation",
+ bus_test_failed_helper_activation
+};
+
+int
+main (int argc, char **argv)
+{
+ return bus_test_main (argc, argv, 1, &test);
+}
diff --git a/test/bus/dispatch.c b/test/bus/helper-activation.c
index bd86419f..f4c9a37d 100644
--- a/test/bus/dispatch.c
+++ b/test/bus/helper-activation.c
@@ -24,7 +24,7 @@
#include <config.h>
#include "test/bus/common.h"
-static DBusTestCase test = { "dispatch", bus_dispatch_test };
+static DBusTestCase test = { "helper-activation", bus_test_helper_activation };
int
main (int argc, char **argv)
diff --git a/test/bus/normal-activation.c b/test/bus/normal-activation.c
new file mode 100644
index 00000000..ce935a5f
--- /dev/null
+++ b/test/bus/normal-activation.c
@@ -0,0 +1,33 @@
+/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
+/*
+ * Copyright 2003-2009 Red Hat, Inc.
+ * Copyright 2011-2018 Collabora Ltd.
+ *
+ * Licensed under the Academic Free License version 2.1
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ */
+
+#include <config.h>
+#include "test/bus/common.h"
+
+static DBusTestCase test = { "normal-activation", bus_test_normal_activation };
+
+int
+main (int argc, char **argv)
+{
+ return bus_test_main (argc, argv, 1, &test);
+}
diff --git a/test/meson.build b/test/meson.build
index 28e4f0bb..c593a801 100644
--- a/test/meson.build
+++ b/test/meson.build
@@ -242,14 +242,6 @@ if embedded_tests
'suite': ['slow'],
},
{
- 'name': 'bus-dispatch',
- 'srcs': [ 'bus/dispatch.c', 'bus/common.c' ],
- 'link': [ libdbus_testutils, libdbus_daemon_internal, ],
- 'install': false,
- 'suite': ['slow'],
- 'timeout': 3000,
- },
- {
'name': 'marshal-recursive',
'srcs': [
'internals/dbus-marshal-recursive-util.c',
@@ -273,9 +265,36 @@ if embedded_tests
},
]
+ if use_traditional_activation
+ tests += [
+ {
+ 'name': 'bus-normal-activation',
+ 'srcs': [ 'bus/normal-activation.c', 'bus/common.c' ],
+ 'link': [ libdbus_testutils, libdbus_daemon_internal, ],
+ 'install': false,
+ 'suite': ['slow'],
+ 'timeout': 1000,
+ },
+ ]
+ endif
+
if use_traditional_activation and platform_unix
tests += [
{
+ 'name': 'bus-failed-helper-activation',
+ 'srcs': [ 'bus/failed-helper-activation.c', 'bus/common.c' ],
+ 'link': [ libdbus_testutils, libdbus_daemon_internal, ],
+ 'install': false,
+ },
+ {
+ 'name': 'bus-helper-activation',
+ 'srcs': [ 'bus/helper-activation.c', 'bus/common.c' ],
+ 'link': [ libdbus_testutils, libdbus_daemon_internal, ],
+ 'install': false,
+ 'suite': ['slow'],
+ 'timeout': 1000,
+ },
+ {
'name': 'bus-launch-helper-oom',
'srcs': [ 'bus/launch-helper-oom.c' ],
'link': [ libdbus_testutils, liblaunch_helper_internal, ],