From 6df5106ddb3957452fcddd3f146427a99f30556c Mon Sep 17 00:00:00 2001
From: Simon McVittie <simon.mcvittie@collabora.co.uk>
Date: Mon, 19 Oct 2015 15:18:02 +0100
Subject: [PATCH 3/6] Disable activation tests on Windows builds

These rely on the --systemd-activation code path, which is not
compiled for Windows.
---
 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 6734ab9..5812c1a 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 f2f37df..ad4b195 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,
@@ -1307,6 +1309,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)
 {
@@ -1333,6 +1337,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,
@@ -1346,6 +1351,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,
@@ -1575,6 +1581,7 @@ test_activation (Fixture *f,
       "com.example.Nope");
   dbus_message_unref (m);
 }
+#endif /* DBUS_UNIX */
 
 static void
 teardown (Fixture *f,
@@ -1667,8 +1674,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 ();
 }
-- 
2.6.1