From ade4f2e84e0fa3df47d8db4140652ca50b8e9fa8 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. --- libnm-glib/tests/Makefile.am | 15 ++++++--------- libnm-glib/tests/libnm-glib-test-launch.sh | 7 +++++++ 2 files changed, 13 insertions(+), 9 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 2723aa4479..dc5a7b8771 100644 --- a/libnm-glib/tests/Makefile.am +++ b/libnm-glib/tests/Makefile.am @@ -10,7 +10,9 @@ 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 ####### NMClient and non-settings tests ####### @@ -36,13 +38,8 @@ test_remote_settings_client_LDADD = \ ########################################### -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; +TESTS_ENVIRONMENT = $(srcdir)/libnm-glib-test-launch.sh endif + +EXTRA_DIST = 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