summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2015-01-26 15:47:22 +0000
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2015-02-03 16:19:01 +0000
commit1e21cc86bfca68d7b5bd564e4c6b086e2a7d242c (patch)
tree4e36b43ab92c46f491eb143dea5a94e325f96d21 /test
parentee032f5a119a9c8a36cfb6c6ff8762b16f640278 (diff)
downloaddbus-1e21cc86bfca68d7b5bd564e4c6b086e2a7d242c.tar.gz
test: implement GLib-style "installed tests"
We run each test twice: * once with the system's session.conf, as an integration test (test-cases that need a special configuration are automatically skipped) * once with our special test configuration files, which provide better coverage Bug: https://bugs.freedesktop.org/show_bug.cgi?id=88810 Reviewed-by: Philip Withnall
Diffstat (limited to 'test')
-rw-r--r--test/Makefile.am39
1 files changed, 33 insertions, 6 deletions
diff --git a/test/Makefile.am b/test/Makefile.am
index 294291bb..ec761605 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -136,9 +136,11 @@ manual_tcp_LDADD = $(top_builddir)/dbus/libdbus-internal.la
EXTRA_DIST = dbus-test-runner
-testexecdir = $(libdir)/dbus-1.0/test
+testexecdir = $(libexecdir)/installed-tests/dbus
+testmetadir = $(datadir)/installed-tests/dbus
testexec_PROGRAMS =
+testmeta_DATA =
installable_tests = \
test-shell \
@@ -166,6 +168,9 @@ installable_manual_tests += \
$(NULL)
endif DBUS_WITH_GLIB
+installable_test_meta = $(installable_tests:=.test)
+installable_test_meta_with_config = $(installable_tests:=_with_config.test)
+
installcheck_tests =
installcheck_environment = \
XDG_RUNTIME_DIR=@abs_top_builddir@/test/XDG_RUNTIME_DIR \
@@ -241,6 +246,9 @@ installcheck_tests += $(installable_tests)
if DBUS_ENABLE_INSTALLED_TESTS
testexec_PROGRAMS += $(installable_tests) $(installable_manual_tests)
+
+ testmeta_DATA += $(installable_test_meta)
+ testmeta_DATA += $(installable_test_meta_with_config)
else !DBUS_ENABLE_INSTALLED_TESTS
noinst_PROGRAMS += $(installable_tests) $(installable_manual_tests)
endif !DBUS_ENABLE_INSTALLED_TESTS
@@ -414,14 +422,19 @@ install-data-local: install-config-local
install-config-local: installable-config-local
if DBUS_ENABLE_INSTALLED_TESTS
- $(AM_V_gen)set -e; \
+ $(AM_V_GEN)set -e; \
for F in $(static_data); do \
- install -m644 "$(srcdir)/$$F" "$(testexecdir)/$$F"; \
- done
+ install -d "$(DESTDIR)$(testexecdir)/$${F%/*}"; \
+ install -m644 "$(srcdir)/$$F" "$(DESTDIR)$(testexecdir)/$$F"; \
+ done; \
for F in $(in_data); do \
- install -d "$${F%/*}";
- install -m644 "installable/$${F%.in}" "$(testexecdir)/$${F%.in}"; \
+ install -d "$(DESTDIR)$(testexecdir)/$${F%/*}"; \
+ install -m644 "installable/$${F%.in}" "$(DESTDIR)$(testexecdir)/$${F%.in}"; \
done
+ ln -nfs $(sysconfdir)/dbus-1/session.conf $(DESTDIR)$(testexecdir)/data/valid-config-files/session.conf
+ ln -nfs $(sysconfdir)/dbus-1/session.d $(DESTDIR)$(testexecdir)/data/valid-config-files/session.d
+ ln -nfs $(sysconfdir)/dbus-1/system.conf $(DESTDIR)$(testexecdir)/data/valid-config-files/system.conf
+ ln -nfs $(sysconfdir)/dbus-1/system.d $(DESTDIR)$(testexecdir)/data/valid-config-files/system.d
else
@:
endif
@@ -452,3 +465,17 @@ CLEANFILES = \
$(imported_data): data/valid-config-files/%.conf: $(top_builddir)/bus/%.conf
$(AM_V_at)$(MKDIR_P) data/valid-config-files
$(AM_V_GEN)cp $< $@
+
+$(installable_test_meta): %.test: % Makefile
+ $(AM_V_GEN) ( \
+ echo '[Test]'; \
+ echo 'Type=session'; \
+ echo 'Exec=env DBUS_TEST_HOME=$$(pwd)/home.tmp $(testexecdir)/$*'; \
+ ) > $@.tmp && mv $@.tmp $@
+
+$(installable_test_meta_with_config): %_with_config.test: % Makefile
+ $(AM_V_GEN) ( \
+ echo '[Test]'; \
+ echo 'Type=session'; \
+ echo 'Exec=env DBUS_TEST_HOME=$$(pwd)/home.tmp DBUS_TEST_DATA=$(testexecdir)/data $(testexecdir)/$*'; \
+ ) > $@.tmp && mv $@.tmp $@