aboutsummaryrefslogtreecommitdiff
path: root/test cases
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2018-02-22 20:29:28 +0200
committerGitHub <noreply@github.com>2018-02-22 20:29:28 +0200
commit2f21e1ffc06ca41dac132018e8bef5bd2fe95ab1 (patch)
tree348615e4c228a98afe0318a6cd7c7eb95d3f7eb6 /test cases
parent56c6489a6cc5879186999dbdab0e54c51210c2f2 (diff)
parent0097ce4c4ed872aee9e8cd58b6981b4cfd62e089 (diff)
downloadmeson-2f21e1ffc06ca41dac132018e8bef5bd2fe95ab1.zip
meson-2f21e1ffc06ca41dac132018e8bef5bd2fe95ab1.tar.gz
meson-2f21e1ffc06ca41dac132018e8bef5bd2fe95ab1.tar.bz2
Merge pull request #3060 from jon-turney/always-run-framework-tests
Always run all framework tests on all platforms
Diffstat (limited to 'test cases')
-rw-r--r--test cases/frameworks/1 boost/meson.build5
-rw-r--r--test cases/frameworks/10 gtk-doc/meson.build5
-rw-r--r--test cases/frameworks/11 gir subproject/meson.build12
-rw-r--r--test cases/frameworks/12 multiple gir/meson.build5
-rw-r--r--test cases/frameworks/13 yelp/meson.build6
-rw-r--r--test cases/frameworks/15 llvm/meson.build7
-rw-r--r--test cases/frameworks/16 sdl2/meson.build6
-rw-r--r--test cases/frameworks/19 pcap/meson.build8
-rw-r--r--test cases/frameworks/19 pcap/pcap_prog.c8
-rw-r--r--test cases/frameworks/20 cups/meson.build6
-rw-r--r--test cases/frameworks/4 qt/meson.build8
-rw-r--r--test cases/frameworks/6 gettext/installed_files.txt2
-rw-r--r--test cases/frameworks/6 gettext/meson.build9
-rw-r--r--test cases/frameworks/7 gnome/meson.build11
-rw-r--r--test cases/frameworks/8 flex/meson.build13
-rw-r--r--test cases/frameworks/8 flex/prog.c2
16 files changed, 102 insertions, 11 deletions
diff --git a/test cases/frameworks/1 boost/meson.build b/test cases/frameworks/1 boost/meson.build
index 771ecbc..df55b30 100644
--- a/test cases/frameworks/1 boost/meson.build
+++ b/test cases/frameworks/1 boost/meson.build
@@ -5,6 +5,11 @@ add_project_arguments(['-DBOOST_LOG_DYN_LINK'],
language : 'cpp'
)
+dep = dependency('boost', required: false)
+if not dep.found()
+ error('MESON_SKIP_TEST boost not found.')
+endif
+
# We want to have multiple separate configurations of Boost
# within one project. The need to be independent of each other.
# Use one without a library dependency and one with it.
diff --git a/test cases/frameworks/10 gtk-doc/meson.build b/test cases/frameworks/10 gtk-doc/meson.build
index e5e7705..71f341c 100644
--- a/test cases/frameworks/10 gtk-doc/meson.build
+++ b/test cases/frameworks/10 gtk-doc/meson.build
@@ -1,5 +1,10 @@
project('gtkdoctest', 'c', version : '1.0.0')
+gtkdoc = find_program('gtkdoc-scan', required: false)
+if not gtkdoc.found()
+ error('MESON_SKIP_TEST gtkdoc not found.')
+endif
+
gnome = import('gnome')
assert(gnome.gtkdoc_html_dir('foobar') == 'share/gtk-doc/html/foobar', 'Gtkdoc install dir is incorrect.')
diff --git a/test cases/frameworks/11 gir subproject/meson.build b/test cases/frameworks/11 gir subproject/meson.build
index f3bde40..a599ae9 100644
--- a/test cases/frameworks/11 gir subproject/meson.build
+++ b/test cases/frameworks/11 gir subproject/meson.build
@@ -1,5 +1,16 @@
project('gobject-introspection-with-subproject', 'c')
+gir = find_program('g-ir-scanner', required: false)
+if not gir.found()
+ error('MESON_SKIP_TEST g-ir-scanner not found.')
+endif
+
+python3 = import('python3')
+py3 = python3.find_python()
+if run_command(py3, '-c', 'import gi;').returncode() != 0
+ error('MESON_SKIP_TEST python3-gi not found')
+endif
+
gnome = import('gnome')
gobj = dependency('gobject-2.0')
@@ -7,4 +18,3 @@ add_global_arguments('-DMESON_TEST', language : 'c')
meson_gir = dependency('meson-gir', fallback : ['mesongir', 'meson_gir'])
subdir('gir')
-
diff --git a/test cases/frameworks/12 multiple gir/meson.build b/test cases/frameworks/12 multiple gir/meson.build
index 794abc5..ddc9830 100644
--- a/test cases/frameworks/12 multiple gir/meson.build
+++ b/test cases/frameworks/12 multiple gir/meson.build
@@ -1,5 +1,10 @@
project('multiple-gobject-introspection', 'c')
+gir = find_program('g-ir-scanner', required: false)
+if not gir.found()
+ error('MESON_SKIP_TEST g-ir-scanner not found.')
+endif
+
gnome = import('gnome')
gobj = dependency('gobject-2.0')
diff --git a/test cases/frameworks/13 yelp/meson.build b/test cases/frameworks/13 yelp/meson.build
index 725ff7b..9fdde25 100644
--- a/test cases/frameworks/13 yelp/meson.build
+++ b/test cases/frameworks/13 yelp/meson.build
@@ -1,2 +1,8 @@
project('yelp', 'c')
+
+itstool = find_program('itstool', required: false)
+if not itstool.found()
+ error('MESON_SKIP_TEST itstool not found.')
+endif
+
subdir('help')
diff --git a/test cases/frameworks/15 llvm/meson.build b/test cases/frameworks/15 llvm/meson.build
index 549adce..b5505eb 100644
--- a/test cases/frameworks/15 llvm/meson.build
+++ b/test cases/frameworks/15 llvm/meson.build
@@ -1,5 +1,10 @@
project('llvmtest', ['c', 'cpp'], default_options : ['c_std=c99'])
+d = dependency('llvm', required : false)
+if not d.found()
+ error('MESON_SKIP_TEST llvm not found.')
+endif
+
d = dependency('llvm', modules : 'not-found', required : false)
assert(d.found() == false, 'not-found llvm module found')
@@ -12,7 +17,7 @@ assert(d.found() == true, 'optional module stopped llvm from being found.')
dep_tinfo = dependency('tinfo', required : false)
if not dep_tinfo.found()
cpp = meson.get_compiler('cpp')
- dep_tinfo = cpp.find_library('tinfo')
+ dep_tinfo = cpp.find_library('tinfo', required: false)
endif
foreach static : [true, false]
diff --git a/test cases/frameworks/16 sdl2/meson.build b/test cases/frameworks/16 sdl2/meson.build
index 61a34ef..1bbf09f 100644
--- a/test cases/frameworks/16 sdl2/meson.build
+++ b/test cases/frameworks/16 sdl2/meson.build
@@ -1,6 +1,10 @@
project('sdl2 test', 'c')
-sdl2_dep = dependency('sdl2', version : '>=2.0.0')
+sdl2_dep = dependency('sdl2', version : '>=2.0.0', required: false)
+
+if not sdl2_dep.found()
+ error('MESON_SKIP_TEST sdl2 not found.')
+endif
e = executable('sdl2prog', 'sdl2prog.c', dependencies : sdl2_dep)
diff --git a/test cases/frameworks/19 pcap/meson.build b/test cases/frameworks/19 pcap/meson.build
index f02f411..eb6fc2c 100644
--- a/test cases/frameworks/19 pcap/meson.build
+++ b/test cases/frameworks/19 pcap/meson.build
@@ -1,6 +1,10 @@
project('pcap test', 'c')
-pcap_dep = dependency('pcap', version : '>=1.0')
+pcap_dep = dependency('pcap', version : '>=1.0', required: false)
+
+if not pcap_dep.found()
+ error('MESON_SKIP_TEST pcap not found.')
+endif
pcap_ver = pcap_dep.version()
assert(pcap_ver.split('.').length() > 1, 'pcap version is "@0@"'.format(pcap_ver))
@@ -9,6 +13,6 @@ e = executable('pcap_prog', 'pcap_prog.c', dependencies : pcap_dep)
test('pcaptest', e)
-# Ensure discovery bia the configuration tools work also
+# Ensure discovery via the configuration tools work also
pcap_dep = dependency('pcap', version : '>=1.0', method : 'pcap-config')
pcap_dep = dependency('pcap', version : '>=1.0', method : 'config-tool')
diff --git a/test cases/frameworks/19 pcap/pcap_prog.c b/test cases/frameworks/19 pcap/pcap_prog.c
index 18e0ad8..0fca16c 100644
--- a/test cases/frameworks/19 pcap/pcap_prog.c
+++ b/test cases/frameworks/19 pcap/pcap_prog.c
@@ -4,6 +4,12 @@ int
main()
{
char errbuf[PCAP_ERRBUF_SIZE];
- pcap_t *p = pcap_create(NULL, errbuf);
+#ifdef __APPLE__
+ // source = NULL for "any" doesn't work on macOS (linux only?)
+ char *source = "en0";
+#else
+ char *source = NULL;
+#endif
+ pcap_t *p = pcap_create(source, errbuf);
return p == NULL;
}
diff --git a/test cases/frameworks/20 cups/meson.build b/test cases/frameworks/20 cups/meson.build
index 11f6f63..9040de6 100644
--- a/test cases/frameworks/20 cups/meson.build
+++ b/test cases/frameworks/20 cups/meson.build
@@ -1,6 +1,10 @@
project('cups test', 'c')
-cups_dep = dependency('cups', version : '>=1.4')
+cups_dep = dependency('cups', version : '>=1.4', required: false)
+
+if not cups_dep.found()
+ error('MESON_SKIP_TEST cups not found.')
+endif
e = executable('cups_prog', 'cups_prog.c', dependencies : cups_dep)
diff --git a/test cases/frameworks/4 qt/meson.build b/test cases/frameworks/4 qt/meson.build
index b0e848d..b508df3 100644
--- a/test cases/frameworks/4 qt/meson.build
+++ b/test cases/frameworks/4 qt/meson.build
@@ -21,6 +21,14 @@ foreach qt : ['qt4', 'qt5']
error('Invalid qt dep incorrectly found!')
endif
+ # This test should be skipped if qt5 isn't found
+ if qt == 'qt5'
+ dep = dependency(qt, modules : ['Core'], required : false, method : get_option('method'))
+ if not dep.found()
+ error('MESON_SKIP_TEST qt5 not found.')
+ endif
+ endif
+
# Ensure that the "no-Core-module-specified" code branch is hit
nocoredep = dependency(qt, modules : ['Gui'], required : qt == 'qt5', method : get_option('method'))
diff --git a/test cases/frameworks/6 gettext/installed_files.txt b/test cases/frameworks/6 gettext/installed_files.txt
index ffe543f..879f56b 100644
--- a/test cases/frameworks/6 gettext/installed_files.txt
+++ b/test cases/frameworks/6 gettext/installed_files.txt
@@ -1,4 +1,4 @@
-usr/bin/intlprog
+usr/bin/intlprog?exe
usr/share/locale/de/LC_MESSAGES/intltest.mo
usr/share/locale/fi/LC_MESSAGES/intltest.mo
usr/share/applications/test.desktop
diff --git a/test cases/frameworks/6 gettext/meson.build b/test cases/frameworks/6 gettext/meson.build
index 6b517a4..e02234b 100644
--- a/test cases/frameworks/6 gettext/meson.build
+++ b/test cases/frameworks/6 gettext/meson.build
@@ -1,5 +1,14 @@
project('gettext example', 'c')
+gettext = find_program('gettext', required: false)
+if not gettext.found()
+ error('MESON_SKIP_TEST gettext not found.')
+endif
+
+if not meson.get_compiler('c').has_header('libintl.h')
+ error('MESON_SKIP_TEST libintl.h not found.')
+endif
+
i18n = import('i18n')
subdir('po')
diff --git a/test cases/frameworks/7 gnome/meson.build b/test cases/frameworks/7 gnome/meson.build
index 795f458..03335b8 100644
--- a/test cases/frameworks/7 gnome/meson.build
+++ b/test cases/frameworks/7 gnome/meson.build
@@ -1,5 +1,16 @@
project('gobject-introspection', 'c')
+glib = dependency('glib-2.0', required: false)
+if not glib.found()
+ error('MESON_SKIP_TEST glib not found.')
+endif
+
+python3 = import('python3')
+py3 = python3.find_python()
+if run_command(py3, '-c', 'import gi;').returncode() != 0
+ error('MESON_SKIP_TEST python3-gi not found')
+endif
+
cc = meson.get_compiler('c')
add_global_arguments('-DMESON_TEST', language : 'c')
diff --git a/test cases/frameworks/8 flex/meson.build b/test cases/frameworks/8 flex/meson.build
index 13ac9f6..cb5efde 100644
--- a/test cases/frameworks/8 flex/meson.build
+++ b/test cases/frameworks/8 flex/meson.build
@@ -4,8 +4,16 @@ project('flex and bison', 'c')
# may output headers that are necessary to build
# the sources of a different generator.
-flex = find_program('flex')
-bison = find_program('bison')
+flex = find_program('flex', required: false)
+bison = find_program('bison', required: false)
+
+if not flex.found()
+ error('MESON_SKIP_TEST flex not found.')
+endif
+
+if not bison.found()
+ error('MESON_SKIP_TEST bison not found.')
+endif
lgen = generator(flex,
output : '@PLAINNAME@.yy.c',
@@ -23,4 +31,3 @@ e = executable('pgen', 'prog.c',
lfiles, pfiles)
test('parsertest', e)
-
diff --git a/test cases/frameworks/8 flex/prog.c b/test cases/frameworks/8 flex/prog.c
index 1e48f61..0b84d18 100644
--- a/test cases/frameworks/8 flex/prog.c
+++ b/test cases/frameworks/8 flex/prog.c
@@ -6,6 +6,8 @@
#include<stdio.h>
#include<stdlib.h>
+extern int yyparse();
+
int main(int argc, char **argv) {
/*
int input;