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 EXTRA_DIST = dbus-test-runner
88 testexecdir = $(libdir)/dbus-1.0/test
95 test-dbus-daemon-eavesdrop \
102 installcheck_environment = \
103 DBUS_TEST_DAEMON=$(DESTDIR)$(DBUS_DAEMONDIR)/dbus-daemon$(EXEEXT) \
104 DBUS_TEST_SYSCONFDIR=$(DESTDIR)$(sysconfdir)
106 TESTS_ENVIRONMENT = \
107 DBUS_BLOCK_ON_ABORT=1 \
108 DBUS_FATAL_WARNINGS=1 \
109 DBUS_TEST_DAEMON=@abs_top_builddir@/bus/dbus-daemon$(EXEEXT) \
110 DBUS_TEST_DATA=@abs_top_builddir@/test/data \
111 DBUS_TEST_HOMEDIR=@abs_top_builddir@/dbus \
114 test_corrupt_SOURCES = corrupt.c
115 test_corrupt_LDADD = $(top_builddir)/dbus/libdbus-1.la \
119 test_loopback_SOURCES = loopback.c
120 test_loopback_LDADD = $(top_builddir)/dbus/libdbus-1.la \
124 test_relay_SOURCES = relay.c
125 test_relay_LDADD = $(top_builddir)/dbus/libdbus-1.la \
129 test_dbus_daemon_SOURCES = dbus-daemon.c
130 test_dbus_daemon_LDADD = $(top_builddir)/dbus/libdbus-1.la \
134 test_dbus_daemon_eavesdrop_SOURCES = dbus-daemon-eavesdrop.c
135 test_dbus_daemon_eavesdrop_CPPFLAGS = $(GLIB_CFLAGS) $(DBUS_GLIB_CFLAGS)
136 test_dbus_daemon_eavesdrop_LDFLAGS = @R_DYNAMIC_LDFLAG@
137 test_dbus_daemon_eavesdrop_LDADD = $(top_builddir)/dbus/libdbus-1.la \
141 test_marshal_SOURCES = marshal.c
142 test_marshal_LDADD = $(top_builddir)/dbus/libdbus-1.la \
146 if DBUS_ENABLE_MODULAR_TESTS
147 TESTS += $(installable_tests)
148 installcheck_tests += $(installable_tests)
150 if DBUS_ENABLE_INSTALLED_TESTS
151 testexec_PROGRAMS += $(installable_tests)
152 else !DBUS_ENABLE_INSTALLED_TESTS
153 noinst_PROGRAMS += $(installable_tests)
154 endif !DBUS_ENABLE_INSTALLED_TESTS
156 endif DBUS_ENABLE_MODULAR_TESTS
158 # If we're installing the tests into a DESTDIR we can't run them
159 # again using the installed copy, because we don't know how to
160 # do a portable equivalent of setting LD_LIBRARY_PATH.
162 $(MAKE) check-TESTS TESTS='$$(installcheck_tests)' \
163 TESTS_ENVIRONMENT='$$(installcheck_environment)'
164 if DBUS_ENABLE_INSTALLED_TESTS
165 test -n "$(DESTDIR)" || \
166 $(installcheck_environment) \
167 $(srcdir)/dbus-test-runner \
170 endif DBUS_ENABLE_INSTALLED_TESTS
172 ## keep these in creation order, i.e. uppermost dirs first
175 data/valid-messages \
176 data/invalid-messages \
177 data/incomplete-messages \
180 data/valid-config-files \
181 data/valid-config-files-system \
182 data/valid-config-files/basic.d \
183 data/valid-config-files/session.d \
184 data/valid-config-files/system.d \
185 data/valid-service-files \
186 data/valid-service-files-system \
187 data/invalid-service-files-system \
188 data/invalid-config-files \
189 data/invalid-config-files-system \
190 data/equiv-config-files \
191 data/equiv-config-files/basic \
192 data/equiv-config-files/basic/basic.d \
193 data/equiv-config-files/entities \
194 data/equiv-config-files/entities/basic.d
197 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" \)
200 for D in $(TESTDIRS); do \
201 test -d $(distdir)/$$D || mkdir $(distdir)/$$D || exit 1 ; \
203 FILES=`(cd $(srcdir) && $(FIND_TESTS) -o -name "*.in" -a -not -name Makefile.in | grep -Ev "(.svn|CVS)" )` ; \
204 for F in $$FILES; do \
206 if test -e $$F.in; then \
207 echo "-- Skipping file $$F (.in version exists)"; \
208 elif test "x$$B" = xrun-with-tmp-session-bus.conf; then \
209 echo "-- Skipping file $$F (generated)"; \
210 elif test -e "$(top_srcdir)/bus/$$B"; then \
211 echo "-- Skipping file $$F (from /bus/)"; \
213 echo '-- Disting file '$$F ; \
214 cp -f $(srcdir)/$$F $(distdir)/$$F || exit 1; \
218 ## copy tests to builddir so that generated tests and static tests
219 ## are all in one place.
221 $(AM_V_at)for D in $(TESTDIRS); do \
222 test -d $(top_builddir)/test/$$D || mkdir $(top_builddir)/test/$$D || exit 1 ; \
224 if ! (test $(srcdir) = . || test $(srcdir) -ef .) ; then \
225 FILES=`(cd $(srcdir) && $(FIND_TESTS) | grep -Ev "(.svn|CVS)" )` ; \
226 for F in $$FILES; do \
227 SRC=$(srcdir)/$$F ; \
228 DEST=$(top_builddir)/test/$$F ; \
229 echo '-- Copying test file '$$F ; \
230 cp $$SRC $$DEST || exit 1 ; \
231 chmod u+w $$DEST || exit 1 ; \
234 echo '-- No need to copy test data as srcdir = builddir' ; \
236 echo '-- Copying' $(top_builddir)/bus/*.conf 'to test directory' ; \
237 cp $(top_builddir)/bus/*.conf $(top_builddir)/test/data/valid-config-files || exit 1 ; \
238 chmod u+w $(top_builddir)/test/data/valid-config-files/*.conf || exit 1
240 ## this doesn't clean generated test data files when srcdir=builddir
242 if test $(srcdir) != . ; then \
243 FILES=`(cd $(top_builddir)/test && $(FIND_TESTS) | grep -Ev "(.svn|CVS)" )` ; \
244 for F in $$FILES; do \
245 DEST=$(top_builddir)/test/$$F ; \
246 echo '-- Deleting test file '$$F ; \
247 rm $$DEST || exit 1 ; \
250 for D in $(TESTDIRS); do \
251 REVERSEDIRS="$$D $$REVERSEDIRS" ; \
253 for D in $$REVERSEDIRS; do \
254 rmdir $(top_builddir)/test/$$D || exit 1 ; \