add missing slash in %configure
[platform/upstream/libsoup.git] / tests / Makefile.am
1 include $(top_srcdir)/glib-tap.mk
2
3 AM_CPPFLAGS =           \
4         -I$(top_srcdir) \
5         $(GLIB_CFLAGS)
6
7 LIBS =                  \
8         $(top_builddir)/libsoup/libsoup-2.4.la \
9         $(GLIB_LIBS)
10
11 test_programs =                 \
12         auth-test               \
13         cache-test              \
14         chunk-test              \
15         chunk-io-test           \
16         coding-test             \
17         connection-test         \
18         context-test            \
19         continue-test           \
20         cookies-test            \
21         date                    \
22         forms-test              \
23         header-parsing          \
24         misc-test               \
25         multipart-test          \
26         no-ssl-test             \
27         ntlm-test               \
28         proxy-test              \
29         pull-api                \
30         range-test              \
31         redirect-test           \
32         requester-test          \
33         resource-test           \
34         session-test            \
35         server-auth-test        \
36         server-test             \
37         sniffing-test           \
38         socket-test             \
39         ssl-test                \
40         streaming-test          \
41         timeout-test            \
42         tld-test                \
43         uri-parsing             \
44         xmlrpc-server-test      \
45         xmlrpc-test
46
47 test_extra_programs =           \
48         ntlm-test-helper        \
49         $(TESTS)
50
51 test_data =                     \
52         index.txt               \
53         soup-tests.gresource    \
54         test-cert.pem           \
55         test-key.pem            \
56         xmlrpc-server.php
57
58 noinst_LTLIBRARIES += libtest.la
59
60 libtest_la_SOURCES =    \
61         test-utils.c    \
62         test-utils.h
63
64 LDADD = libtest.la
65
66 if HAVE_APACHE
67 if HAVE_APACHE_2_2
68 httpd_conf_in = httpd.conf.22.in
69 else
70 httpd_conf_in = httpd.conf.24.in
71 endif
72 httpd.conf: $(httpd_conf_in)
73         $(AM_V_GEN) sed -e 's,[@]srcdir@,$(srcdir),' \
74             -e 's,[@]builddir@,$(builddir),' \
75             -e 's,[@]APACHE_MODULE_DIR@,$(APACHE_MODULE_DIR),' \
76             -e 's,[@]APACHE_PHP_MODULE_DIR@,$(APACHE_PHP_MODULE_DIR),' \
77             -e 's,[@]APACHE_PHP_MODULE@,$(APACHE_PHP_MODULE),' \
78             -e 's,[@]IF_HAVE_PHP@,$(IF_HAVE_PHP),' \
79             -e 's,[@]APACHE_SSL_MODULE_DIR@,$(APACHE_SSL_MODULE_DIR),' \
80             $< > $@ || rm -f $@
81
82 BUILT_SOURCES += httpd.conf
83 test_data +=                    \
84         htdigest                \
85         htpasswd                \
86         httpd.conf
87 endif
88
89 RESOURCES = $(shell $(GLIB_COMPILE_RESOURCES) --sourcedir=$(srcdir) --generate-dependencies $(srcdir)/soup-tests.gresource.xml)
90
91 soup-tests.gresource: soup-tests.gresource.xml $(RESOURCES)
92         $(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(srcdir) $<
93
94 EXTRA_DIST +=                    \
95         htdigest                 \
96         htpasswd                 \
97         httpd.conf.22.in         \
98         httpd.conf.24.in         \
99         index.txt                \
100         libsoup.supp             \
101         soup-tests.gresource.xml \
102         test-cert.pem            \
103         test-key.pem             \
104         xmlrpc-server.php        \
105         $(RESOURCES)
106
107 DISTCLEANFILES += soup-tests.gresource httpd.conf
108
109 TESTS_ENVIRONMENT += SOUP_TESTS_IN_MAKE_CHECK=1
110
111 check: start-httpd
112
113 check-local: check-TESTS
114         @$(MAKE) kill-httpd
115
116 .PHONY: start-httpd kill-httpd
117
118 start-httpd:
119 if HAVE_APACHE_2_2
120         @$(APACHE_HTTPD) -d $(abs_srcdir) -c "PidFile `pwd`/httpd.pid" -f `pwd`/httpd.conf -k start;
121 endif
122 if HAVE_APACHE_2_4
123         @$(APACHE_HTTPD) -d $(abs_srcdir) -c "DefaultRuntimeDir `pwd`" -c "PidFile `pwd`/httpd.pid" -f `pwd`/httpd.conf -k start;
124 endif
125
126 kill-httpd:
127 if HAVE_APACHE_2_2
128         @if [ -f httpd.pid ]; then \
129                 $(APACHE_HTTPD) -d $(abs_srcdir) -c "PidFile `pwd`/httpd.pid" -f `pwd`/httpd.conf -k stop; \
130         fi
131 endif
132 if HAVE_APACHE_2_4
133         @if [ -f httpd.pid ]; then \
134                 $(APACHE_HTTPD) -d $(abs_srcdir) -c "DefaultRuntimeDir `pwd`" -c "PidFile `pwd`/httpd.pid" -f `pwd`/httpd.conf -k stop; \
135         fi
136 endif