mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager
synced 2024-09-06 09:04:55 +00:00
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.
This commit is contained in:
parent
4f7e9bd336
commit
ade4f2e84e
|
@ -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
|
||||
|
|
7
libnm-glib/tests/libnm-glib-test-launch.sh
Executable file
7
libnm-glib/tests/libnm-glib-test-launch.sh
Executable file
|
@ -0,0 +1,7 @@
|
|||
#!/bin/sh
|
||||
|
||||
if [ -z "$DBUS_SESSION_BUS_ADDRESS" ]; then
|
||||
exec dbus-launch --exit-with-session "$@"
|
||||
else
|
||||
exec "$@"
|
||||
fi
|
Loading…
Reference in a new issue