tests: do skipped tests properly
[platform/upstream/libsoup.git] / tests / Makefile.am
1 INCLUDES =              \
2         -I$(top_srcdir) \
3         -DSRCDIR=\""$(abs_srcdir)"\" \
4         -DBUILDDIR=\""$(builddir)"\" \
5         $(SOUP_MAINTAINER_FLAGS) \
6         $(XML_CFLAGS)   \
7         $(GLIB_CFLAGS)
8
9 LIBS =                  \
10         $(top_builddir)/libsoup/libsoup-2.4.la \
11         $(LIBGNUTLS_LIBS) \
12         $(GLIB_LIBS)
13
14 TESTS =                         \
15         auth-test               \
16         cache-test              \
17         chunk-test              \
18         coding-test             \
19         connection-test         \
20         context-test            \
21         continue-test           \
22         cookies-test            \
23         date                    \
24         forms-test              \
25         header-parsing          \
26         misc-test               \
27         multipart-test          \
28         ntlm-test               \
29         proxy-test              \
30         pull-api                \
31         range-test              \
32         redirect-test           \
33         requester-test          \
34         resource-test           \
35         session-test            \
36         server-auth-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 noinst_PROGRAMS =               \
48         $(TESTS)                \
49         dns                     \
50         get                     \
51         ntlm-test-helper        \
52         simple-httpd            \
53         simple-proxy
54
55 noinst_DATA = soup-tests.gresource
56
57 noinst_LTLIBRARIES = libtest.la
58
59 libtest_la_SOURCES =    \
60         test-utils.c    \
61         test-utils.h
62
63 LDADD = libtest.la
64
65 if HAVE_APACHE
66 if HAVE_APACHE_2_2
67 httpd_conf_in = httpd.conf.22.in
68 else
69 httpd_conf_in = httpd.conf.24.in
70 endif
71 httpd.conf: $(httpd_conf_in)
72         $(AM_V_GEN) sed -e 's,[@]srcdir@,$(srcdir),' \
73             -e 's,[@]builddir@,$(builddir),' \
74             -e 's,[@]APACHE_MODULE_DIR@,$(APACHE_MODULE_DIR),' \
75             -e 's,[@]APACHE_PHP_MODULE_DIR@,$(APACHE_PHP_MODULE_DIR),' \
76             -e 's,[@]APACHE_PHP_MODULE@,$(APACHE_PHP_MODULE),' \
77             -e 's,[@]IF_HAVE_PHP@,$(IF_HAVE_PHP),' \
78             -e 's,[@]APACHE_SSL_MODULE_DIR@,$(APACHE_SSL_MODULE_DIR),' \
79             $< > $@ || rm -f $@
80
81 BUILT_SOURCES = httpd.conf
82 endif
83
84 soup-tests.gresource: soup-tests.gresource.xml $(shell $(GLIB_COMPILE_RESOURCES) --sourcedir=$(srcdir) --generate-dependencies $(srcdir)/soup-tests.gresource.xml)
85         $(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(srcdir)  $<
86
87 RESOURCES =                     \
88         resources/atom.xml      \
89         resources/home.gif      \
90         resources/html_binary.html \
91         resources/mbox          \
92         resources/mbox.gz       \
93         resources/mbox.raw      \
94         resources/mbox.zlib     \
95         resources/ps_binary.ps  \
96         resources/rss20.xml     \
97         resources/test.html     \
98         resources/text_binary.txt
99
100 EXTRA_DIST =                     \
101         htdigest                 \
102         htpasswd                 \
103         httpd.conf.22.in         \
104         httpd.conf.24.in         \
105         index.txt                \
106         libsoup.supp             \
107         soup-tests.gresource.xml \
108         test-cert.pem            \
109         test-key.pem             \
110         xmlrpc-server.php        \
111         $(RESOURCES)
112
113 DISTCLEANFILES = soup-tests.gresource httpd.conf
114
115 TESTS_ENVIRONMENT = \
116         SOUP_TESTS_IN_MAKE_CHECK=1
117
118 check: start-httpd
119
120 check-local: check-TESTS
121         @$(MAKE) kill-httpd
122 if MISSING_REGRESSION_TEST_PACKAGES
123         @echo ""
124         @echo "NOTE: some tests were not run due to missing packages:" $(MISSING_REGRESSION_TEST_PACKAGES)
125         @echo ""
126 endif
127
128 .PHONY: start-httpd kill-httpd
129
130 start-httpd:
131 if HAVE_APACHE
132         @$(APACHE_HTTPD) -d `pwd` -f httpd.conf -k start;
133 endif
134
135 kill-httpd:
136 if HAVE_APACHE
137         @if [ -f httpd.pid ]; then \
138                 $(APACHE_HTTPD) -d `pwd` -f httpd.conf -k stop; \
139         fi
140 endif