summaryrefslogtreecommitdiff
path: root/tests/Makefile.am
blob: a8b9d019c1c80a6415ef3298895781070ce564d3 (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
include $(top_srcdir)/glib-tap.mk

AM_CPPFLAGS =		\
	-I$(top_srcdir)	\
	$(GLIB_CFLAGS)

LIBS =			\
	$(top_builddir)/libsoup/libsoup-2.4.la \
	$(GLIB_LIBS)

test_programs =			\
	auth-test		\
	cache-test		\
	chunk-test		\
	chunk-io-test		\
	coding-test		\
	connection-test		\
	context-test		\
	continue-test		\
	cookies-test		\
	date			\
	forms-test		\
	header-parsing		\
	misc-test		\
	multipart-test		\
	no-ssl-test		\
	ntlm-test		\
	proxy-test		\
	pull-api		\
	range-test		\
	redirect-test		\
	requester-test		\
	resource-test		\
	session-test		\
	server-auth-test	\
	server-test		\
	sniffing-test		\
	socket-test		\
	ssl-test		\
	streaming-test		\
	timeout-test		\
	tld-test		\
	uri-parsing		\
	xmlrpc-server-test	\
	xmlrpc-test

test_extra_programs =		\
	ntlm-test-helper	\
	$(TESTS)

test_data =			\
	index.txt		\
	soup-tests.gresource	\
	test-cert.pem		\
	test-key.pem		\
	xmlrpc-server.php

noinst_LTLIBRARIES += libtest.la

libtest_la_SOURCES =	\
	test-utils.c	\
	test-utils.h

LDADD = libtest.la

if HAVE_APACHE
if HAVE_APACHE_2_2
httpd_conf_in = httpd.conf.22.in
else
httpd_conf_in = httpd.conf.24.in
endif
httpd.conf: $(httpd_conf_in)
	$(AM_V_GEN) sed -e 's,[@]srcdir@,$(srcdir),' \
	    -e 's,[@]builddir@,$(builddir),' \
	    -e 's,[@]APACHE_MODULE_DIR@,$(APACHE_MODULE_DIR),' \
	    -e 's,[@]APACHE_PHP_MODULE_DIR@,$(APACHE_PHP_MODULE_DIR),' \
	    -e 's,[@]APACHE_PHP_MODULE@,$(APACHE_PHP_MODULE),' \
	    -e 's,[@]IF_HAVE_PHP@,$(IF_HAVE_PHP),' \
	    -e 's,[@]APACHE_SSL_MODULE_DIR@,$(APACHE_SSL_MODULE_DIR),' \
	    $< > $@ || rm -f $@

BUILT_SOURCES += httpd.conf
test_data +=			\
	htdigest		\
	htpasswd		\
	httpd.conf
endif

RESOURCES = $(shell $(GLIB_COMPILE_RESOURCES) --sourcedir=$(srcdir) --generate-dependencies $(srcdir)/soup-tests.gresource.xml)

soup-tests.gresource: soup-tests.gresource.xml $(RESOURCES)
	$(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(srcdir) $<

EXTRA_DIST +=			 \
	htdigest		 \
	htpasswd		 \
	httpd.conf.22.in	 \
	httpd.conf.24.in	 \
	index.txt		 \
	libsoup.supp		 \
	soup-tests.gresource.xml \
	test-cert.pem		 \
	test-key.pem		 \
	xmlrpc-server.php	 \
	$(RESOURCES)

DISTCLEANFILES += soup-tests.gresource httpd.conf

TESTS_ENVIRONMENT += SOUP_TESTS_IN_MAKE_CHECK=1

check: start-httpd

check-local: check-TESTS
	@$(MAKE) kill-httpd

.PHONY: start-httpd kill-httpd

start-httpd:
if HAVE_APACHE_2_2
	@$(APACHE_HTTPD) -d $(abs_srcdir) -c "PidFile `pwd`/httpd.pid" -f `pwd`/httpd.conf -k start;
endif
if HAVE_APACHE_2_4
	@$(APACHE_HTTPD) -d $(abs_srcdir) -c "DefaultRuntimeDir `pwd`" -c "PidFile `pwd`/httpd.pid" -f `pwd`/httpd.conf -k start;
endif

kill-httpd:
if HAVE_APACHE_2_2
	@if [ -f httpd.pid ]; then \
		$(APACHE_HTTPD) -d $(abs_srcdir) -c "PidFile `pwd`/httpd.pid" -f `pwd`/httpd.conf -k stop; \
	fi
endif
if HAVE_APACHE_2_4
	@if [ -f httpd.pid ]; then \
		$(APACHE_HTTPD) -d $(abs_srcdir) -c "DefaultRuntimeDir `pwd`" -c "PidFile `pwd`/httpd.pid" -f `pwd`/httpd.conf -k stop; \
	fi
endif