From 382cb17d37e9098b2dcec6bc20b92467b63a7ae3 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Mon, 19 Oct 2015 15:18:02 +0100 Subject: Disable activation tests on Windows builds These rely on the --systemd-activation code path, which is not compiled for Windows. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92538 Reviewed-by: Ralf Habacker --- test/Makefile.am | 10 +++++++++- test/monitor.c | 11 +++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/test/Makefile.am b/test/Makefile.am index 6734ab99..5812c1a9 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -151,11 +151,17 @@ installable_tests += \ test-marshal \ test-refs \ test-relay \ - test-sd-activation \ test-syntax \ test-syslog \ test-uid-permissions \ $(NULL) + +if DBUS_UNIX +installable_tests += \ + test-sd-activation \ + $(NULL) +endif DBUS_UNIX + installable_manual_tests += \ manual-authz \ $(NULL) @@ -216,6 +222,7 @@ test_dbus_daemon_eavesdrop_LDADD = \ $(GLIB_LIBS) \ $(NULL) +if DBUS_UNIX test_sd_activation_SOURCES = \ sd-activation.c \ $(NULL) @@ -223,6 +230,7 @@ test_sd_activation_LDADD = \ libdbus-testutils.la \ $(GLIB_LIBS) \ $(NULL) +endif test_marshal_SOURCES = marshal.c test_marshal_LDADD = \ diff --git a/test/monitor.c b/test/monitor.c index c099139a..7fef934c 100644 --- a/test/monitor.c +++ b/test/monitor.c @@ -128,11 +128,13 @@ static Config no_eavesdrop_config = { FALSE }; +#ifdef DBUS_UNIX static Config fake_systemd_config = { "valid-config-files/systemd-activation.conf", NULL, FALSE }; +#endif static Config side_effects_config = { NULL, @@ -1158,6 +1160,8 @@ test_selective (Fixture *f, g_assert (m == NULL); } +#ifdef DBUS_UNIX +/* currently only used for the systemd activation test */ static void expect_new_connection (Fixture *f) { @@ -1184,6 +1188,7 @@ expect_new_connection (Fixture *f) dbus_message_unref (m); } +/* currently only used for the systemd activation test */ static void take_well_known_name (Fixture *f, DBusConnection *connection, @@ -1197,6 +1202,7 @@ take_well_known_name (Fixture *f, g_assert_cmpint (ret, ==, DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER); } +/* currently only used for the systemd activation test */ static void expect_take_well_known_name (Fixture *f, DBusConnection *connection, @@ -1426,6 +1432,7 @@ test_activation (Fixture *f, "com.example.Nope"); dbus_message_unref (m); } +#endif /* DBUS_UNIX */ static void teardown (Fixture *f, @@ -1516,8 +1523,12 @@ main (int argc, setup, test_unicast_signal, teardown); g_test_add ("/monitor/no-eavesdrop", Fixture, &no_eavesdrop_config, setup, test_unicast_signal, teardown); + +#ifdef DBUS_UNIX + /* this relies on the systemd activation code path */ g_test_add ("/monitor/activation", Fixture, &fake_systemd_config, setup, test_activation, teardown); +#endif return g_test_run (); } -- cgit v1.2.1