summaryrefslogtreecommitdiff
path: root/tests/twisted/Makefile.am
blob: 2706e7c6dee1ba00411b0a4885c3fbcdf6865fc5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
TWISTED_TESTS = \
	addressing.py \
	avatar-requirements.py \
	caps/advertise-contact-caps.py \
	caps/broken-reply.py \
	caps/caps-cache.py \
	caps/caps-persistent-cache.py \
	caps/compat-bundles.py \
	caps/disco-without-node.py \
	caps/double-disco.py \
	caps/from-bare-jid.py \
	caps/hashed-caps.py \
	caps_helper.py \
	caps/initial-caps.py \
	caps/jingle-caps.py \
	caps/offline.py \
	caps/receive-jingle.py \
	caps/trust-thyself.py \
	caps/tube-caps.py \
	client-types.py \
	cm/protocol.py \
	connect/disco-error-from-bare-jid.py \
	connect/disco-facebook.py \
	connect/disconnect-timeout.py \
	connect/disco-no-reply.py \
	connect/network-error.py \
	connect/stream-closed.py \
	connect/test-connection-params.py \
	connect/test-fail.py \
	connect/test-nonblocking-tls.py \
	connect/test-success.py \
	connect/test-twice.py \
	console.py \
	dataforms.py \
	gateways.py \
	last-activity.py \
	mail-notification.py \
	muc/avatars.py \
	muc/banned.py \
	muc/chat-states.py \
	muc/conference.py \
	muc/kicked.py \
	muc/name-conflict.py \
	muc/password.py \
	muc/presence-before-closing.py \
	muc/renamed.py \
	muc/room-config.py \
	muc/roomlist.py \
	muc/room.py \
	muc/scrollback.py \
	muc/send-error.py \
	muc/subject.py \
	muc/test-ensure.py \
	muc/test-muc-alias.py \
	muc/test-muc-invitation.py \
	muc/test-muc-ownership.py \
	muc/test-muc.py \
	pep-support.py \
	plugin-channel-managers.py \
	power-save.py \
	presence/error.py \
	presence/initial-contact-presence.py \
	presence/initial-presence.py \
	presence/invisible_xep_0126.py \
	presence/invisible_xep_0186.py \
	presence/plugins.py \
	presence/presence.py \
	presence/set-idempotence.py \
	presence/shared-status.py \
	pubsub.py \
	roster/authorize.py \
	roster/edit-before-roster.py \
	roster/groups-12791.py \
	roster/groups.py \
	roster/initial-aliases.py \
	roster/push-from-contact.py \
	roster/push-without-id.py \
	roster/removed-from-rp-subscribe.py \
	roster/test-google-roster.py \
	roster/test-roster-item-deletion.py \
	roster/test-roster.py \
	roster/test-roster-subscribe.py \
	roster/test-save-alias-to-roster.py \
	sasl/abort.py \
	sasl/close.py \
	sasl/complex.py \
	sasl/jabber_auth.py \
	sasl/plain.py \
	sasl/telepathy-password.py \
	search/ceci-nest-pas-un-serveur.py \
	search/extended.py \
	search/no-server-property.py \
	search/unextended.py \
	servicetest.py \
	sidecar-own-caps.py \
	sidecars.py \
	test-debug.py \
	test-fallback-socks5-proxy.py \
	test-location.py \
	test-register.py \
	text/destroy.py \
	text/ensure.py \
	text/facebook-own-message.py \
	text/initiate.py \
	text/initiate-requestotron.py \
	text/receipts.py \
	text/respawn.py \
	text/send-error.py \
	text/send-to-correct-resource.py \
	text/test-chat-state.py \
	text/test-text-delayed.py \
	text/test-text-no-body.py \
	text/test-text.py \
	tls/legacy-jabber.py \
	tls/server-tls-channel.py \
	version.py \
	$(NULL)

TWISTED_TUBE_TESTS = \
	tubes/accept-muc-dbus-tube.py \
	tubes/accept-muc-stream-tube.py \
	tubes/accept-private-dbus-tube.py \
	tubes/accept-private-stream-tube.py \
	tubes/check-create-tube-return.py \
	tubes/close-muc-with-closed-tube.py \
	tubes/create-invalid-tube-channels.py \
	tubes/ensure-si-tube.py \
	tubes/offer-muc-dbus-tube.py \
	tubes/offer-muc-stream-tube.py \
	tubes/offer-no-caps.py \
	tubes/offer-private-dbus-tube.py \
	tubes/offer-private-stream-tube.py \
	tubes/request-invalid-dbus-tube.py \
	tubes/test-get-available-tubes.py \
	tubes/test-socks5-muc.py \
	$(NULL)

TWISTED_VCARD_TESTS = \
	vcard/clear-avatar.py \
	vcard/disconnect-during-pep.py \
	vcard/get-contact-info.py \
	vcard/item-not-found.py \
	vcard/overlapping-sets.py \
	vcard/redundant-set.py \
	vcard/refresh-contact-info.py \
	vcard/set-avatar.py \
	vcard/set-contact-info.py \
	vcard/set-set-disconnect.py \
	vcard/supported-fields.py \
	vcard/test-alias-empty-vcard.py \
	vcard/test-alias-message.py \
	vcard/test-alias-pep.py \
	vcard/test-alias.py \
	vcard/test-avatar-async.py \
	vcard/test-avatar-multiple-resources.py \
	vcard/test-avatar.py \
	vcard/test-avatar-retrieved.py \
	vcard/test-avatar-tokens.py \
	vcard/test-save-alias-to-vcard.py \
	vcard/test-set-alias.py \
	vcard/test-vcard-cache.py \
	vcard/test-vcard-race.py \
	vcard/update-get-failed.py \
	vcard/update-rejected.py \
	$(NULL)

TWISTED_JINGLE_TESTS = \
	jingle/call-basics.py \
	jingle/call-codecoffer.py \
	jingle/call-content-adding-removal.py \
	jingle/call-dtmf.py \
	jingle/call-google-relay.py \
	jingle/call-hold-audio.py \
	jingle/call-hold-av.py \
	jingle/call-muc-cancel.py \
	jingle/call-muc.py \
	jingle/call-muc-re-re-request.py \
	jingle/preload-caps-crash.py \
	jingle/session-id-collision.py \
	jingle/stun-server.py \
	jingle/unknown-session.py \
	$(NULL)

TWISTED_FT_TESTS = \
	file-transfer/test-caps-file-transfer.py \
	file-transfer/test-ibb-too-early.py \
	file-transfer/test-receive-file-and-close-socket-while-receiving.py \
	file-transfer/test-receive-file-and-disconnect.py \
	file-transfer/test-receive-file-and-sender-disconnect-while-pending.py \
	file-transfer/test-receive-file-and-sender-disconnect-while-transfering.py \
	file-transfer/test-receive-file-decline.py \
	file-transfer/test-receive-file.py \
	file-transfer/test-send-file-and-cancel-immediately.py \
	file-transfer/test-send-file-declined.py \
	file-transfer/test-send-file-provide-immediately.py \
	file-transfer/test-send-file-send-before-accept.py \
	file-transfer/test-send-file-to-unknown-contact.py \
	file-transfer/test-send-file-wait-to-provide.py \
	file-transfer/test-uri.py \
	file-transfer/metadata.py \
	file-transfer/ft-client-caps.py \
	jingle-share/test-caps-file-transfer.py \
	jingle-share/test-multift.py \
	jingle-share/test-receive-file-and-close-socket-while-receiving.py \
	jingle-share/test-receive-file-and-disconnect.py \
	jingle-share/test-receive-file-and-sender-disconnect-while-pending.py \
	jingle-share/test-receive-file-and-sender-disconnect-while-transfering.py \
	jingle-share/test-receive-file-decline.py \
	jingle-share/test-send-file-and-cancel-immediately.py \
	jingle-share/test-send-file.py \
	jingle-share/test-send-file-send-before-accept.py \
	jingle-share/test-send-file-wait-to-provide.py \
	$(NULL)

# other files used by the twisted tests, but are not tests and are not built
# source
TWISTED_OTHER_FILES = \
	bytestream.py \
	connect/torture.py \
	constants.py \
	file-transfer/file_transfer_helper.py \
	gabbletest.py \
	httptest.py \
	jingle/call_helper.py \
	jingle/callutils.py \
	jingle/__init__.py \
	jingle/jingletest2.py \
	jingle-share/file_transfer_helper.py \
	jingle-share/jingleshareutils.py \
	mucutil.py \
	ns.py \
	presence_helper.py \
	presence/__init__.py \
	presence/invisible_helper.py \
	rostertest.py \
	sasl/saslutil.py \
	search/search_helper.py \
	test-helper.py \
	tls-cert.pem \
	tls-key.pem \
	tubes/tubetestutil.py \
	$(NULL)

twistedtestsdir = @gabbletestsdir@/twisted

if ENABLE_INSTALLED_TESTS
# Install files in each directory. They could be tests, pristine data files,
# scripts or built source
nobase_nodist_twistedtests_SCRIPTS = \
	run-test.sh \
	tools/exec-with-log.sh \
	tools/run-gabble.sh \
	$(NULL)
nobase_dist_twistedtests_SCRIPTS = \
	tools/with-session-bus.sh \
	$(NULL)
nobase_dist_twistedtests_DATA = \
	$(TWISTED_TESTS) \
	$(TWISTED_OTHER_FILES) \
	$(NULL)
nobase_nodist_twistedtests_DATA = \
	config.py \
	gabble-twisted-tests.list \
	$(installed_conf_files) \
	$(service_files)
	$(NULL)
endif

check-local: check-coding-style check-twisted

# set to 6 when using refdbg, to give Gabble time to exit
CHECK_TWISTED_SLEEP=0

check-twisted: $(BUILT_SOURCES)
if WANT_TWISTED_TESTS
	rm -f tools/core
	rm -f tools/vgcore.*
	rm -f tools/gabble-testing.log
	rm -f tools/strace.log
	if test -n "$$GABBLE_TEST_REFDBG"; then \
	  sleep=6; \
        else \
	  sleep=$(CHECK_TWISTED_SLEEP); \
	fi; \
	failed=0; \
	GABBLE_TEST_UNINSTALLED=1 \
	  CHECK_TWISTED_SLEEP="--sleep=$$sleep" \
	  G_TEST_SRCDIR=@abs_srcdir@ \
	  G_TEST_BUILDDIR=@abs_builddir@ \
	  sh run-test.sh "$(TWISTED_TESTS)" || failed=1; \
	if test -e tools/core; then\
		echo -e "\033[0;31;1mCore dump exists: tools/core\033[0m";\
		exit 1;\
	fi; \
	if test $$failed = 1; then\
		exit 1;\
	fi;
else
	@echo "Configured without Twisted test support. To enable them,"
	@echo "ensure that these Python modules are available:"
	@echo " • twisted.words.xish.domish"
	@echo " • twisted.words.protocols.jabber"
	@echo " • twisted.internet.reactor"
	@echo "and then re-run configure."
endif

if ENABLE_PLUGINS
PLUGINS_ENABLED_PYBOOL = True
else
PLUGINS_ENABLED_PYBOOL = False
endif

if ENABLE_GOOGLE_RELAY
GOOGLE_RELAY_ENABLED_PYBOOL = True
else
GOOGLE_RELAY_ENABLED_PYBOOL = False
endif

if ENABLE_FILE_TRANSFER
FILE_TRANSFER_ENABLED_PYBOOL = True
else
FILE_TRANSFER_ENABLED_PYBOOL = False
endif

if ENABLE_VOIP
VOIP_ENABLED_PYBOOL = True
else
VOIP_ENABLED_PYBOOL = False
endif

if ENABLE_JINGLE_FILE_TRANSFER
JINGLE_FILE_TRANSFER_ENABLED_PYBOOL = True
else
JINGLE_FILE_TRANSFER_ENABLED_PYBOOL = False
endif

config.py: Makefile
	$(AM_V_GEN) { \
		echo "PACKAGE_STRING = \"$(PACKAGE_STRING)\""; \
		echo "CLIENT_TYPE = '$(CLIENT_TYPE)'"; \
		echo "PLUGINS_ENABLED = $(PLUGINS_ENABLED_PYBOOL)"; \
		echo "GOOGLE_RELAY_ENABLED = $(GOOGLE_RELAY_ENABLED_PYBOOL)"; \
		echo "FILE_TRANSFER_ENABLED = $(FILE_TRANSFER_ENABLED_PYBOOL)"; \
		echo "VOIP_ENABLED = $(VOIP_ENABLED_PYBOOL)"; \
		echo "JINGLE_FILE_TRANSFER_ENABLED = $(JINGLE_FILE_TRANSFER_ENABLED_PYBOOL)"; \
	} > $@

BUILT_SOURCES = config.py

TWISTED_TESTS += $(TWISTED_FT_TESTS) $(TWISTED_TUBE_TESTS)
TWISTED_TESTS += $(TWISTED_JINGLE_TESTS) $(TWISTED_VCARD_TESTS)

if ENABLE_INSTALLED_TESTS
gabbledebugdir = @gabbletestsdir@/twisted
gabbledebug_PROGRAMS = \
	telepathy-gabble-debug
else
noinst_PROGRAMS = \
	telepathy-gabble-debug
endif

telepathy_gabble_debug_SOURCES = \
    main-debug.c \
    test-resolver.c \
    test-resolver.h

telepathy_gabble_debug_LDADD = \
    $(top_builddir)/src/libgabble-convenience.la \
    $(ALL_LIBS)

telepathy_gabble_debug_LDFLAGS = -export-dynamic

AM_CFLAGS = $(ERROR_CFLAGS) @DBUS_CFLAGS@ @GLIB_CFLAGS@ @WOCKY_CFLAGS@ \
    @TP_GLIB_CFLAGS@ \
    -I $(top_srcdir)/src -I $(top_builddir)/src \
     -I $(top_srcdir)/lib -I $(top_builddir)/lib \
    -I $(top_srcdir) -I $(top_builddir)
ALL_LIBS = @DBUS_LIBS@ @GLIB_LIBS@ @WOCKY_LIBS@ @TP_GLIB_LIBS@

CLEANFILES = gabble-[1-9]*.log *.pyc */*.pyc config.py

check_misc_sources = $(TESTS)

# the following used to be in tools/
include $(top_srcdir)/tools/check-coding-style.mk

gabble-twisted-tests.list: Makefile
	$(AM_V_GEN)echo $(TWISTED_TESTS) > $@

run-test.sh: run-test.sh.in Makefile
	$(AM_V_GEN)sed -e "s|[@]twistedtestsdir[@]|${twistedtestsdir}|g" \
		-e "s|[@]PYTHON[@]|$(PYTHON)|g" \
		-e "s|[@]TEST_PYTHON[@]|$(TEST_PYTHON)|g" \
		 $< > $@
	@chmod +x $@

tools/run-gabble.sh: tools/run-gabble.sh.in Makefile
	@mkdir -p tools
	$(AM_V_GEN)sed \
		-e "s|[@]gabbletestsdir[@]|@gabbletestsdir@|g" \
		-e "s|[@]pluginexecdir[@]|@pluginexecdir@|g" \
		-e "s|[@]libdir[@]|$(libdir)|g" \
		$< > $@
	@chmod +x $@

tools/exec-with-log.sh: tools/exec-with-log.sh.in
	$(MKDIR_P) tools
	$(AM_V_GEN)sed -e "s|[@]abs_top_builddir[@]|@abs_top_builddir@|g" \
		-e "s|[@]abs_top_srcdir[@]|@abs_top_srcdir@|g" $< > $@
	@chmod +x $@

# The wildcard % matches both config files!
tools/%.conf: tools/%.conf.in Makefile
	$(MKDIR_P) tools/servicedir
	$(MKDIR_P) tools/servicedir-uninstalled
	$(AM_V_GEN)sed -e "s|[@]gabbletestsdir[@]|@gabbletestsdir@|g" \
		-e "s|[@]abs_top_builddir[@]|@abs_top_builddir@|g" $< > $@

# We don't use the full filename for the .in because > 99 character filenames
# in tarballs are non-portable (and automake 1.8 doesn't let us build
# non-archaic tarballs)
tools/servicedir/im.telepathy.v1.ConnectionManager.%.service: tools/servicedir/%.service.in  Makefile
	$(MKDIR_P) tools/servicedir
	$(AM_V_GEN)sed -e "s|[@]gabbletestsdir[@]|@gabbletestsdir@|g" $< > $@

tools/servicedir-uninstalled/im.telepathy.v1.ConnectionManager.%.service: tools/servicedir-uninstalled/%.service.in
	$(MKDIR_P) tools/servicedir-uninstalled
	$(AM_V_GEN)sed -e "s|[@]abs_top_builddir[@]|@abs_top_builddir@|g" $< > $@

# D-Bus service file for testing
installed_service_in_files = tools/servicedir/gabble.service.in
service_files = tools/servicedir/im.telepathy.v1.ConnectionManager.gabble.service
uninstalled_service_in_files = tools/servicedir-uninstalled/gabble.service.in
uninstalled_service_files = tools/servicedir-uninstalled/im.telepathy.v1.ConnectionManager.gabble.service

# D-Bus config file for testing
installed_conf_in_files = tools/servicedir/tmp-session-bus.conf.in
installed_conf_files = $(installed_conf_in_files:.conf.in=.conf)
uninstalled_conf_in_files = tools/servicedir-uninstalled/tmp-session-bus.conf.in
uninstalled_conf_files = $(uninstalled_conf_in_files:.conf.in=.conf)

BUILT_SOURCES += \
	$(service_files) \
	$(installed_conf_files) \
	$(uninstalled_service_files) \
	$(uninstalled_conf_files) \
	gabble-twisted-tests.list \
	run-test.sh \
	tools/exec-with-log.sh \
	tools/run-gabble.sh \
	$(NULL)

EXTRA_DIST = \
	$(installed_service_in_files) \
	$(uninstalled_service_in_files) \
	$(installed_conf_in_files) \
	$(uninstalled_conf_in_files) \
	tools/exec-with-log.sh.in \
	tools/run-gabble.sh.in \
	run-test.sh.in \
	$(NULL)

CLEANFILES += \
    $(BUILT_SOURCES) \
    tools/gabble-testing.log