summary refs log tree commit diff
path: root/libnm-glib/tests/Makefile.am
diff options
context:
space:
mode:
Diffstat (limited to 'libnm-glib/tests/Makefile.am')
-rw-r--r--libnm-glib/tests/Makefile.am36
1 files changed, 26 insertions, 10 deletions
diff --git a/libnm-glib/tests/Makefile.am b/libnm-glib/tests/Makefile.am
index 07994481..38f449ac 100644
--- a/libnm-glib/tests/Makefile.am
+++ b/libnm-glib/tests/Makefile.am
@@ -5,20 +5,29 @@ AM_CPPFLAGS = \
 	-I$(top_builddir)/include \
 	-I$(top_srcdir)/libnm-util \
 	-I$(top_builddir)/libnm-util \
-	-I$(top_srcdir)/libnm-glib
+	-I$(top_srcdir)/libnm-glib \
+	-DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \
+	$(GLIB_CFLAGS) \
+	$(DBUS_CFLAGS)
+
+noinst_PROGRAMS = test-nm-client test-remote-settings-client
+
+####### NMClient and non-settings tests #######
 
-noinst_PROGRAMS = test-remote-settings-client
+test_nm_client_SOURCES = \
+	test-nm-client.c
+
+test_nm_client_LDADD = \
+	$(top_builddir)/libnm-util/libnm-util.la \
+	$(top_builddir)/libnm-glib/libnm-glib-test.la \
+	$(GLIB_LIBS) \
+	$(DBUS_LIBS)
 
 ####### remote settings client test #######
 
 test_remote_settings_client_SOURCES = \
 	test-remote-settings-client.c
 
-test_remote_settings_client_CPPFLAGS = \
-	$(GLIB_CFLAGS) \
-	$(DBUS_CFLAGS) \
-	$(AM_CPPFLAGS)
-
 test_remote_settings_client_LDADD = \
 	$(top_builddir)/libnm-util/libnm-util.la \
 	$(top_builddir)/libnm-glib/libnm-glib-test.la \
@@ -27,11 +36,18 @@ test_remote_settings_client_LDADD = \
 
 ###########################################
 
+TEST_NM_BIN = test-fake-nm.py
 TEST_RSS_BIN = test-remote-settings-service.py
 
-EXTRA_DIST = $(TEST_RSS_BIN)
+EXTRA_DIST = $(TEST_RSS_BIN) $(TEST_NM_BIN)
 
-check-local: test-remote-settings-client
-	$(abs_builddir)/test-remote-settings-client $(abs_srcdir) $(TEST_RSS_BIN)
+check-local: test-nm-client test-remote-settings-client
+	if test -z "$$DBUS_SESSION_BUS_ADDRESS" ; then \
+	    dbus-launch --exit-with-session $(abs_builddir)/test-nm-client $(abs_srcdir) $(TEST_NM_BIN); \
+	    dbus-launch --exit-with-session $(abs_builddir)/test-remote-settings-client $(abs_srcdir) $(TEST_RSS_BIN); \
+	else \
+	    $(abs_builddir)/test-nm-client $(abs_srcdir) $(TEST_NM_BIN); \
+	    $(abs_builddir)/test-remote-settings-client $(abs_srcdir) $(TEST_RSS_BIN); \
+	fi;
 
 endif