From edf0317dff92bd986ec9da7da2622fe9ec46a240 Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Wed, 30 Jul 2014 17:32:35 -0400 Subject: [PATCH] libnm-glib: use automake test infrastructure for test programs Use "TESTS = tests-nm-client test-remote-settings-client" rather than overriding "check-local". Add a script "libnm-test-launch.sh" that will handle redirecting the test via dbus-launch if needed. (cherry picked from commit ade4f2e84e0fa3df47d8db4140652ca50b8e9fa8) --- libnm-glib/tests/Makefile.am | 19 +++++++------------ libnm-glib/tests/libnm-glib-test-launch.sh | 7 +++++++ 2 files changed, 14 insertions(+), 12 deletions(-) create mode 100755 libnm-glib/tests/libnm-glib-test-launch.sh diff --git a/libnm-glib/tests/Makefile.am b/libnm-glib/tests/Makefile.am index 79ed4386b6..b4e51bea97 100644 --- a/libnm-glib/tests/Makefile.am +++ b/libnm-glib/tests/Makefile.am @@ -12,7 +12,11 @@ AM_CPPFLAGS = \ $(GLIB_CFLAGS) \ $(DBUS_CFLAGS) -noinst_PROGRAMS = test-nm-client test-remote-settings-client +noinst_PROGRAMS = $(TESTS) + +TESTS = test-nm-client test-remote-settings-client + +TESTS_ENVIRONMENT = $(srcdir)/libnm-glib-test-launch.sh ####### NMClient and non-settings tests ####### @@ -38,15 +42,6 @@ test_remote_settings_client_LDADD = \ ########################################### -EXTRA_DIST = test-fake-nm.py test-remote-settings-service.py - -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; \ - dbus-launch --exit-with-session $(abs_builddir)/test-remote-settings-client; \ - else \ - $(abs_builddir)/test-nm-client; \ - $(abs_builddir)/test-remote-settings-client; \ - fi; - endif + +EXTRA_DIST = test-fake-nm.py test-remote-settings-service.py libnm-glib-test-launch.sh diff --git a/libnm-glib/tests/libnm-glib-test-launch.sh b/libnm-glib/tests/libnm-glib-test-launch.sh new file mode 100755 index 0000000000..1db656ad06 --- /dev/null +++ b/libnm-glib/tests/libnm-glib-test-launch.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +if [ -z "$DBUS_SESSION_BUS_ADDRESS" ]; then + exec dbus-launch --exit-with-session "$@" +else + exec "$@" +fi