1 ## the "name-test" subdir in fact contains a bunch of tests now that need a temporary bus
2 ## to be running to do stuff with. The directory should be renamed.
3 ## We want to build the current directory first to pick up the testutils lib
13 # improve backtraces from test stuff
14 AM_LDFLAGS = @R_DYNAMIC_LDFLAG@
21 libdbus_testutils_la_CPPFLAGS = \
23 libdbus_testutils_la_SOURCES = \
27 libdbus_testutils_la_LIBADD = \
28 $(top_builddir)/dbus/libdbus-internal.la \
31 noinst_LTLIBRARIES = libdbus-testutils.la
34 ## break-loader removed for now
35 ## these binaries are used in tests but are not themselves tests
46 ## These are conceptually part of directories that come earlier in SUBDIRS
47 ## order, but we don't want to run them til we arrive in this directory,
48 ## since they depend on stuff from this directory
50 ../bus/bus-test$(EXEEXT) \
51 ../bus/bus-test-system$(EXEEXT) \
52 ../dbus/dbus-test$(EXEEXT) \
56 TESTS += ../bus/bus-test-launch-helper$(EXEEXT)
59 else !DBUS_BUILD_TESTS
64 endif !DBUS_BUILD_TESTS
66 noinst_PROGRAMS= $(TEST_BINARIES)
68 test_service_CPPFLAGS = $(static_cppflags)
69 test_service_LDADD = libdbus-testutils.la
70 test_names_CPPFLAGS = $(static_cppflags)
71 test_names_LDADD = libdbus-testutils.la
72 ## break_loader_CPPFLAGS = $(static_cppflags)
73 ## break_loader_LDADD = $(top_builddir)/dbus/libdbus-internal.la
74 test_shell_service_CPPFLAGS = $(static_cppflags)
75 test_shell_service_LDADD = libdbus-testutils.la
76 shell_test_CPPFLAGS = $(static_cppflags)
77 shell_test_LDADD = libdbus-testutils.la
78 spawn_test_CPPFLAGS = $(static_cppflags)
79 spawn_test_LDADD = $(top_builddir)/dbus/libdbus-internal.la
81 test_refs_SOURCES = internals/refs.c
82 test_refs_CPPFLAGS = $(static_cppflags)
83 test_refs_LDADD = libdbus-testutils.la $(GLIB_LIBS)
85 test_syslog_SOURCES = internals/syslog.c
86 test_syslog_CPPFLAGS = $(static_cppflags)
87 test_syslog_LDADD = libdbus-testutils.la $(GLIB_LIBS)
89 EXTRA_DIST = dbus-test-runner
91 testexecdir = $(libdir)/dbus-1.0/test
100 installable_tests += \
103 test-dbus-daemon-eavesdrop \
114 installcheck_environment = \
115 DBUS_TEST_DAEMON=$(DESTDIR)$(DBUS_DAEMONDIR)/dbus-daemon$(EXEEXT) \
116 DBUS_TEST_HOMEDIR=@abs_top_builddir@/dbus \
117 DBUS_TEST_SYSCONFDIR=$(DESTDIR)$(sysconfdir)
119 TESTS_ENVIRONMENT = \
120 DBUS_BLOCK_ON_ABORT=1 \
121 DBUS_FATAL_WARNINGS=1 \
122 DBUS_TEST_DAEMON=@abs_top_builddir@/bus/dbus-daemon$(EXEEXT) \
123 DBUS_TEST_DATA=@abs_top_builddir@/test/data \
124 DBUS_TEST_HOMEDIR=@abs_top_builddir@/dbus \
127 test_corrupt_SOURCES = corrupt.c
128 test_corrupt_LDADD = $(top_builddir)/dbus/libdbus-1.la \
132 test_loopback_SOURCES = loopback.c
133 test_loopback_LDADD = $(top_builddir)/dbus/libdbus-1.la \
137 test_relay_SOURCES = relay.c
138 test_relay_LDADD = $(top_builddir)/dbus/libdbus-1.la \
142 test_dbus_daemon_SOURCES = dbus-daemon.c
143 test_dbus_daemon_LDADD = $(top_builddir)/dbus/libdbus-1.la \
147 test_dbus_daemon_eavesdrop_SOURCES = dbus-daemon-eavesdrop.c
148 test_dbus_daemon_eavesdrop_CPPFLAGS = $(GLIB_CFLAGS) $(DBUS_GLIB_CFLAGS)
149 test_dbus_daemon_eavesdrop_LDFLAGS = @R_DYNAMIC_LDFLAG@
150 test_dbus_daemon_eavesdrop_LDADD = $(top_builddir)/dbus/libdbus-1.la \
154 test_marshal_SOURCES = marshal.c
155 test_marshal_LDADD = $(top_builddir)/dbus/libdbus-1.la \
159 test_syntax_SOURCES = syntax.c
160 test_syntax_LDADD = $(top_builddir)/dbus/libdbus-1.la \
163 if DBUS_ENABLE_MODULAR_TESTS
164 TESTS += $(installable_tests)
165 installcheck_tests += $(installable_tests)
167 if DBUS_ENABLE_INSTALLED_TESTS
168 testexec_PROGRAMS += $(installable_tests)
169 else !DBUS_ENABLE_INSTALLED_TESTS
170 noinst_PROGRAMS += $(installable_tests)
171 endif !DBUS_ENABLE_INSTALLED_TESTS
173 endif DBUS_ENABLE_MODULAR_TESTS
175 # If we're installing the tests into a DESTDIR we can't run them
176 # again using the installed copy, because we don't know how to
177 # do a portable equivalent of setting LD_LIBRARY_PATH.
179 $(MAKE) check-TESTS TESTS='$$(installcheck_tests)' \
180 TESTS_ENVIRONMENT='$$(installcheck_environment)'
181 if DBUS_ENABLE_INSTALLED_TESTS
182 test -n "$(DESTDIR)" || \
183 $(installcheck_environment) \
184 $(srcdir)/dbus-test-runner \
187 endif DBUS_ENABLE_INSTALLED_TESTS
189 ## keep these in creation order, i.e. uppermost dirs first
192 data/valid-messages \
193 data/invalid-messages \
194 data/incomplete-messages \
197 data/valid-config-files \
198 data/valid-config-files-system \
199 data/valid-config-files/basic.d \
200 data/valid-config-files/session.d \
201 data/valid-config-files/system.d \
202 data/valid-service-files \
203 data/valid-service-files-system \
204 data/invalid-service-files-system \
205 data/invalid-config-files \
206 data/invalid-config-files-system \
207 data/equiv-config-files \
208 data/equiv-config-files/basic \
209 data/equiv-config-files/basic/basic.d \
210 data/equiv-config-files/entities \
211 data/equiv-config-files/entities/basic.d
214 FIND_TESTS=find . -type f -a \( -name "*.message" -o -name "*.message-raw" -o -name "*.auth-script" -o -name "*.sha1" -o -name "*.txt" -o -name "*.conf" -o -name "*.service" \)
217 for D in $(TESTDIRS); do \
218 test -d $(distdir)/$$D || mkdir $(distdir)/$$D || exit 1 ; \
220 FILES=`(cd $(srcdir) && $(FIND_TESTS) -o -name "*.in" -a -not -name Makefile.in | grep -Ev "(.svn|CVS)" )` ; \
221 for F in $$FILES; do \
223 if test -e $$F.in; then \
224 echo "-- Skipping file $$F (.in version exists)"; \
225 elif test "x$$B" = xrun-with-tmp-session-bus.conf; then \
226 echo "-- Skipping file $$F (generated)"; \
227 elif test -e "$(top_srcdir)/bus/$$B"; then \
228 echo "-- Skipping file $$F (from /bus/)"; \
230 echo '-- Disting file '$$F ; \
231 cp -f $(srcdir)/$$F $(distdir)/$$F || exit 1; \
235 ## copy tests to builddir so that generated tests and static tests
236 ## are all in one place.
238 $(AM_V_at)for D in $(TESTDIRS); do \
239 test -d $(top_builddir)/test/$$D || mkdir $(top_builddir)/test/$$D || exit 1 ; \
241 if ! (test $(srcdir) = . || test $(srcdir) -ef .) ; then \
242 FILES=`(cd $(srcdir) && $(FIND_TESTS) | grep -Ev "(.svn|CVS)" )` ; \
243 for F in $$FILES; do \
244 SRC=$(srcdir)/$$F ; \
245 DEST=$(top_builddir)/test/$$F ; \
246 echo '-- Copying test file '$$F ; \
247 cp $$SRC $$DEST || exit 1 ; \
248 chmod u+w $$DEST || exit 1 ; \
251 echo '-- No need to copy test data as srcdir = builddir' ; \
253 echo '-- Copying' $(top_builddir)/bus/*.conf 'to test directory' ; \
254 cp $(top_builddir)/bus/*.conf $(top_builddir)/test/data/valid-config-files || exit 1 ; \
255 chmod u+w $(top_builddir)/test/data/valid-config-files/*.conf || exit 1
257 ## this doesn't clean generated test data files when srcdir=builddir
259 if test $(srcdir) != . ; then \
260 FILES=`(cd $(top_builddir)/test && $(FIND_TESTS) | grep -Ev "(.svn|CVS)" )` ; \
261 for F in $$FILES; do \
262 DEST=$(top_builddir)/test/$$F ; \
263 echo '-- Deleting test file '$$F ; \
264 rm $$DEST || exit 1 ; \
267 for D in $(TESTDIRS); do \
268 REVERSEDIRS="$$D $$REVERSEDIRS" ; \
270 for D in $$REVERSEDIRS; do \
271 rmdir $(top_builddir)/test/$$D || \
272 test ! -d $(top_builddir)/test/$$D || \