summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomas Popela <tpopela@redhat.com>2018-04-17 11:33:02 +0200
committerTomas Popela <tpopela@redhat.com>2018-04-18 08:20:04 +0200
commit964e13057e577820f9557df7fa7ced99c8a62c82 (patch)
treec2dd50e15928c0d7735a0501dcb6b4400f1b97ff
parent1e1b4c19d848d026bf0b6d196ad68c9e8aa3b405 (diff)
downloadlibsoup-964e13057e577820f9557df7fa7ced99c8a62c82.tar.gz
meson: Only compile and install test the have all the prerequisites
This is to avoid situations when you don't have Apache, but the test that require Apache will be compiled and installed, the same applies for xmlrpc. https://bugzilla.gnome.org/show_bug.cgi?id=795324
-rw-r--r--tests/meson.build93
1 files changed, 52 insertions, 41 deletions
diff --git a/tests/meson.build b/tests/meson.build
index 10fda5d4..c32a64c5 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -14,12 +14,10 @@ test_resources = gnome.compile_resources('soup-tests',
# ['name', is_parallel]
tests = [
- ['auth', false],
['cache', true],
['chunk', true],
['chunk-io', true],
['coding', true],
- ['connection', false],
['context', true],
['continue', true],
['cookies', true],
@@ -30,9 +28,6 @@ tests = [
['multipart', true],
['no-ssl', true],
['ntlm', true],
- ['proxy', true],
- ['pull-api', false],
- ['range', false],
['redirect', true],
['requester', true],
['resource', true],
@@ -46,13 +41,60 @@ tests = [
['timeout', true],
['tld', true],
['uri-parsing', true],
- ['websocket', true],
- ['xmlrpc-old-server', true],
- ['xmlrpc-old', false],
- ['xmlrpc-server', true],
- ['xmlrpc', false]
+ ['websocket', true]
]
+if have_apache
+ tests += [
+ ['auth', false],
+ ['connection', false],
+ ['range', false],
+ ['proxy', true],
+ ['pull-api', false],
+ ]
+
+ configure_file(output : 'httpd.conf',
+ input : 'httpd.conf.in',
+ configuration : cdata)
+
+ # There is not copy_file() in Meson and this is official workaround as per
+ # https://github.com/mesonbuild/meson/issues/860
+ configure_file(input : 'htdigest',
+ output : 'htdigest',
+ configuration : configuration_data())
+ configure_file(input : 'htpasswd',
+ output : 'htpasswd',
+ configuration : configuration_data())
+ configure_file(input : 'index.txt',
+ output : 'index.txt',
+ configuration : configuration_data())
+ configure_file(input : 'test-cert.pem',
+ output : 'test-cert.pem',
+ configuration : configuration_data())
+ configure_file(input : 'test-key.pem',
+ output : 'test-key.pem',
+ configuration : configuration_data())
+endif
+
+if have_php
+ configure_file(output : 'php.ini',
+ input : 'php.ini.in',
+ configuration : cdata)
+endif
+
+if have_php_xmlrpc
+ tests += [
+ ['xmlrpc-old-server', true, have_php_xmlrpc],
+ ['xmlrpc-old', false, have_php_xmlrpc],
+ ['xmlrpc-server', true, have_php_xmlrpc],
+ ['xmlrpc', false, have_php_xmlrpc]
+ ]
+
+ configure_file(input : 'xmlrpc-server.php',
+ output : 'xmlrpc-server.php',
+ configuration : configuration_data())
+endif
+
env = environment()
env.set('G_TEST_SRCDIR', meson.current_source_dir())
env.set('G_TEST_BUILDDIR', meson.current_build_dir())
@@ -72,34 +114,3 @@ endforeach
executable('ntlm-test-helper', 'ntlm-test-helper.c',
dependencies : [glib_dep, libsoup_dep])
-
-configure_file(output : 'httpd.conf',
- input : 'httpd.conf.in',
- configuration : cdata)
-
-if have_php
- configure_file(output : 'php.ini',
- input : 'php.ini.in',
- configuration : cdata)
-endif
-
-# There is not copy_file() in Meson and this is official workaround as per
-# https://github.com/mesonbuild/meson/issues/860
-configure_file(input : 'htdigest',
- output : 'htdigest',
- configuration : configuration_data())
-configure_file(input : 'htpasswd',
- output : 'htpasswd',
- configuration : configuration_data())
-configure_file(input : 'index.txt',
- output : 'index.txt',
- configuration : configuration_data())
-configure_file(input : 'test-cert.pem',
- output : 'test-cert.pem',
- configuration : configuration_data())
-configure_file(input : 'test-key.pem',
- output : 'test-key.pem',
- configuration : configuration_data())
-configure_file(input : 'xmlrpc-server.php',
- output : 'xmlrpc-server.php',
- configuration : configuration_data())