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@
16 libdbus_testutils_la_SOURCES = \
20 libdbus_testutils_la_LIBADD = \
21 $(top_builddir)/dbus/libdbus-internal.la \
24 noinst_LTLIBRARIES = libdbus-testutils.la
27 ## break-loader removed for now
28 ## most of these binaries are used in tests but are not themselves tests
40 ## these are the things to run in make check (i.e. they are actual tests)
41 ## (binaries in here must also be in TEST_BINARIES)
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)
73 test_service_CPPFLAGS = $(static_cppflags)
74 test_service_LDADD = libdbus-testutils.la
75 test_names_CPPFLAGS = $(static_cppflags)
76 test_names_LDADD = libdbus-testutils.la
77 ## break_loader_CPPFLAGS = $(static_cppflags)
78 ## break_loader_LDADD = $(top_builddir)/dbus/libdbus-internal.la
79 test_shell_service_CPPFLAGS = $(static_cppflags)
80 test_shell_service_LDADD = libdbus-testutils.la
81 shell_test_CPPFLAGS = $(static_cppflags)
82 shell_test_LDADD = libdbus-testutils.la
83 spawn_test_CPPFLAGS = $(static_cppflags)
84 spawn_test_LDADD = $(top_builddir)/dbus/libdbus-internal.la
86 test_refs_SOURCES = internals/refs.c
87 test_refs_CPPFLAGS = $(static_cppflags)
88 test_refs_LDADD = libdbus-testutils.la $(GLIB_LIBS)
90 EXTRA_DIST = dbus-test-runner
92 testexecdir = $(libdir)/dbus-1.0/test
99 test-dbus-daemon-eavesdrop \
107 installcheck_environment = \
108 DBUS_TEST_DAEMON=$(DESTDIR)$(DBUS_DAEMONDIR)/dbus-daemon$(EXEEXT) \
109 DBUS_TEST_SYSCONFDIR=$(DESTDIR)$(sysconfdir)
111 TESTS_ENVIRONMENT = \
112 DBUS_BLOCK_ON_ABORT=1 \
113 DBUS_FATAL_WARNINGS=1 \
114 DBUS_TEST_DAEMON=@abs_top_builddir@/bus/dbus-daemon$(EXEEXT) \
115 DBUS_TEST_DATA=@abs_top_builddir@/test/data \
116 DBUS_TEST_HOMEDIR=@abs_top_builddir@/dbus \
119 test_corrupt_SOURCES = corrupt.c
120 test_corrupt_LDADD = $(top_builddir)/dbus/libdbus-1.la \
124 test_loopback_SOURCES = loopback.c
125 test_loopback_LDADD = $(top_builddir)/dbus/libdbus-1.la \
129 test_relay_SOURCES = relay.c
130 test_relay_LDADD = $(top_builddir)/dbus/libdbus-1.la \
134 test_dbus_daemon_SOURCES = dbus-daemon.c
135 test_dbus_daemon_LDADD = $(top_builddir)/dbus/libdbus-1.la \
139 test_dbus_daemon_eavesdrop_SOURCES = dbus-daemon-eavesdrop.c
140 test_dbus_daemon_eavesdrop_CPPFLAGS = $(GLIB_CFLAGS) $(DBUS_GLIB_CFLAGS)
141 test_dbus_daemon_eavesdrop_LDFLAGS = @R_DYNAMIC_LDFLAG@
142 test_dbus_daemon_eavesdrop_LDADD = $(top_builddir)/dbus/libdbus-1.la \
146 test_marshal_SOURCES = marshal.c
147 test_marshal_LDADD = $(top_builddir)/dbus/libdbus-1.la \
151 if DBUS_ENABLE_MODULAR_TESTS
152 TESTS += $(installable_tests)
153 installcheck_tests += $(installable_tests)
155 if DBUS_ENABLE_INSTALLED_TESTS
156 testexec_PROGRAMS += $(installable_tests)
157 else !DBUS_ENABLE_INSTALLED_TESTS
158 noinst_PROGRAMS += $(installable_tests)
159 endif !DBUS_ENABLE_INSTALLED_TESTS
161 endif DBUS_ENABLE_MODULAR_TESTS
163 # If we're installing the tests into a DESTDIR we can't run them
164 # again using the installed copy, because we don't know how to
165 # do a portable equivalent of setting LD_LIBRARY_PATH.
167 $(MAKE) check-TESTS TESTS='$$(installcheck_tests)' \
168 TESTS_ENVIRONMENT='$$(installcheck_environment)'
169 if DBUS_ENABLE_INSTALLED_TESTS
170 test -n "$(DESTDIR)" || \
171 $(installcheck_environment) \
172 $(srcdir)/dbus-test-runner \
175 endif DBUS_ENABLE_INSTALLED_TESTS
177 ## keep these in creation order, i.e. uppermost dirs first
180 data/valid-messages \
181 data/invalid-messages \
182 data/incomplete-messages \
185 data/valid-config-files \
186 data/valid-config-files-system \
187 data/valid-config-files/basic.d \
188 data/valid-config-files/session.d \
189 data/valid-config-files/system.d \
190 data/valid-service-files \
191 data/valid-service-files-system \
192 data/invalid-service-files-system \
193 data/invalid-config-files \
194 data/invalid-config-files-system \
195 data/equiv-config-files \
196 data/equiv-config-files/basic \
197 data/equiv-config-files/basic/basic.d \
198 data/equiv-config-files/entities \
199 data/equiv-config-files/entities/basic.d
202 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" \)
205 for D in $(TESTDIRS); do \
206 test -d $(distdir)/$$D || mkdir $(distdir)/$$D || exit 1 ; \
208 FILES=`(cd $(srcdir) && $(FIND_TESTS) -o -name "*.in" -a -not -name Makefile.in | grep -Ev "(.svn|CVS)" )` ; \
209 for F in $$FILES; do \
211 if test -e $$F.in; then \
212 echo "-- Skipping file $$F (.in version exists)"; \
213 elif test "x$$B" = xrun-with-tmp-session-bus.conf; then \
214 echo "-- Skipping file $$F (generated)"; \
215 elif test -e "$(top_srcdir)/bus/$$B"; then \
216 echo "-- Skipping file $$F (from /bus/)"; \
218 echo '-- Disting file '$$F ; \
219 cp -f $(srcdir)/$$F $(distdir)/$$F || exit 1; \
223 ## copy tests to builddir so that generated tests and static tests
224 ## are all in one place.
226 $(AM_V_at)for D in $(TESTDIRS); do \
227 test -d $(top_builddir)/test/$$D || mkdir $(top_builddir)/test/$$D || exit 1 ; \
229 if ! (test $(srcdir) = . || test $(srcdir) -ef .) ; then \
230 FILES=`(cd $(srcdir) && $(FIND_TESTS) | grep -Ev "(.svn|CVS)" )` ; \
231 for F in $$FILES; do \
232 SRC=$(srcdir)/$$F ; \
233 DEST=$(top_builddir)/test/$$F ; \
234 echo '-- Copying test file '$$F ; \
235 cp $$SRC $$DEST || exit 1 ; \
236 chmod u+w $$DEST || exit 1 ; \
239 echo '-- No need to copy test data as srcdir = builddir' ; \
241 echo '-- Copying' $(top_builddir)/bus/*.conf 'to test directory' ; \
242 cp $(top_builddir)/bus/*.conf $(top_builddir)/test/data/valid-config-files || exit 1 ; \
243 chmod u+w $(top_builddir)/test/data/valid-config-files/*.conf || exit 1
245 ## this doesn't clean generated test data files when srcdir=builddir
247 if test $(srcdir) != . ; then \
248 FILES=`(cd $(top_builddir)/test && $(FIND_TESTS) | grep -Ev "(.svn|CVS)" )` ; \
249 for F in $$FILES; do \
250 DEST=$(top_builddir)/test/$$F ; \
251 echo '-- Deleting test file '$$F ; \
252 rm $$DEST || exit 1 ; \
255 for D in $(TESTDIRS); do \
256 REVERSEDIRS="$$D $$REVERSEDIRS" ; \
258 for D in $$REVERSEDIRS; do \
259 rmdir $(top_builddir)/test/$$D || exit 1 ; \