aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2020-01-23 17:29:51 +0530
committerNirbheek Chauhan <nirbheek.chauhan@gmail.com>2020-01-24 02:53:34 +0530
commit2c8e676e2bc490e7d7e9e2649fcbc2d9afefd5e0 (patch)
tree1527db3ea2bf2b13599d1c6234c5ed057febd0c4
parent4d93a1142749e86bc09764cef7f591776d3b523e (diff)
downloadmeson-2c8e676e2bc490e7d7e9e2649fcbc2d9afefd5e0.zip
meson-2c8e676e2bc490e7d7e9e2649fcbc2d9afefd5e0.tar.gz
meson-2c8e676e2bc490e7d7e9e2649fcbc2d9afefd5e0.tar.bz2
tests: Fix some test failures on Ubuntun 16.04 CI
* xenial doesn't ship many dependencies, so make them all optional since we don't guarantee that everything will work * cmake/{5,6}: needs stdlib.h for EXIT_SUCCESS on GCC 5 * common/222: needs C++11, and GCC 5 doesn't understand `auto` correctly unless we explicitly enable it. * frameworks/1 boost: xenial doesn't ship boost_python3, so make it properly optional * frameworks/6 gettext: gettext can be installed without xgettext, which doesn't cause the project to fail, but the installed files list is different which causes the test to fail. * frameworks/7 gnome: gobject-introspection can't be enabled because the sanitizer unit test detects leaks in glib and fails
-rw-r--r--.github/workflows/os_comp.yml3
-rwxr-xr-xrun_project_tests.py4
-rw-r--r--test cases/cmake/5 object library/main.cpp1
-rw-r--r--test cases/cmake/6 object library no dep/main.cpp1
-rw-r--r--test cases/common/222 source set realistic example/meson.build2
-rw-r--r--test cases/frameworks/1 boost/meson.build16
-rw-r--r--test cases/frameworks/6 gettext/meson.build5
-rw-r--r--test cases/frameworks/7 gnome/meson.build5
8 files changed, 22 insertions, 15 deletions
diff --git a/.github/workflows/os_comp.yml b/.github/workflows/os_comp.yml
index ce89573..b5aafa0 100644
--- a/.github/workflows/os_comp.yml
+++ b/.github/workflows/os_comp.yml
@@ -11,7 +11,7 @@ jobs:
- name: Install Dependencies
run: |
sudo apt update -yq
- sudo apt install -yq --no-install-recommends g++ gfortran ninja-build gobjc gobjc++ zlib1g-dev
+ sudo apt install -yq --no-install-recommends python3-setuptools python3-pip g++ gfortran gobjc gobjc++ zlib1g-dev
- name: Install ninja-build tool
uses: seanmiddleditch/gha-setup-ninja@v1
- name: Python version
@@ -22,3 +22,4 @@ jobs:
run: python3 run_tests.py
env:
CI: '1'
+ XENIAL: '1'
diff --git a/run_project_tests.py b/run_project_tests.py
index c0adb8e..e480160 100755
--- a/run_project_tests.py
+++ b/run_project_tests.py
@@ -94,6 +94,7 @@ class AutoDeletedDir:
failing_logs = []
print_debug = 'MESON_PRINT_TEST_OUTPUT' in os.environ
under_ci = 'CI' in os.environ
+under_xenial_ci = under_ci and ('XENIAL' in os.environ)
do_debug = under_ci or print_debug
no_meson_log_msg = 'No meson-log.txt found.'
@@ -539,7 +540,8 @@ def have_java():
return False
def skippable(suite, test):
- if not under_ci:
+ # Everything is optional when not running on CI, or on Ubuntu 16.04 CI
+ if not under_ci or under_xenial_ci:
return True
if not suite.endswith('frameworks'):
diff --git a/test cases/cmake/5 object library/main.cpp b/test cases/cmake/5 object library/main.cpp
index cdf54f1..9933ab4 100644
--- a/test cases/cmake/5 object library/main.cpp
+++ b/test cases/cmake/5 object library/main.cpp
@@ -1,3 +1,4 @@
+#include <stdlib.h>
#include <iostream>
#include "libA.hpp"
#include "libB.hpp"
diff --git a/test cases/cmake/6 object library no dep/main.cpp b/test cases/cmake/6 object library no dep/main.cpp
index cdf54f1..9933ab4 100644
--- a/test cases/cmake/6 object library no dep/main.cpp
+++ b/test cases/cmake/6 object library no dep/main.cpp
@@ -1,3 +1,4 @@
+#include <stdlib.h>
#include <iostream>
#include "libA.hpp"
#include "libB.hpp"
diff --git a/test cases/common/222 source set realistic example/meson.build b/test cases/common/222 source set realistic example/meson.build
index ea91e29..5b0e495 100644
--- a/test cases/common/222 source set realistic example/meson.build
+++ b/test cases/common/222 source set realistic example/meson.build
@@ -1,7 +1,7 @@
# a sort-of realistic example that combines the sourceset and kconfig
# modules, inspired by QEMU's build system
-project('sourceset-example', 'cpp')
+project('sourceset-example', 'cpp', default_options: ['cpp_std=c++11'])
cppid = meson.get_compiler('cpp').get_id()
if cppid == 'pgi'
diff --git a/test cases/frameworks/1 boost/meson.build b/test cases/frameworks/1 boost/meson.build
index b528dca..2dce40d 100644
--- a/test cases/frameworks/1 boost/meson.build
+++ b/test cases/frameworks/1 boost/meson.build
@@ -40,14 +40,10 @@ if(python2dep.found() and host_machine.system() == 'linux')
# on the installed version of python (and hope that they match the version boost
# was compiled against)
py2version_string = ''.join(python2dep.version().split('.'))
- bpython2dep = dependency('boost', modules : ['python' + py2version_string])
+ bpython2dep = dependency('boost', modules : ['python' + py2version_string], required: false, disabler: true)
else
# if we have an older version of boost, we need to use the old module names
- bpython2dep = dependency('boost', modules : ['python'])
- endif
-
- if not (bpython2dep.found())
- bpython2dep = disabler()
+ bpython2dep = dependency('boost', modules : ['python'], required: false, disabler: true)
endif
else
python2dep = disabler()
@@ -57,13 +53,9 @@ endif
if(python3dep.found() and host_machine.system() == 'linux')
if(dep.version().version_compare('>=1.67'))
py3version_string = ''.join(python3dep.version().split('.'))
- bpython3dep = dependency('boost', modules : ['python' + py3version_string])
+ bpython3dep = dependency('boost', modules : ['python' + py3version_string], required: false, disabler: true)
else
- bpython3dep = dependency('boost', modules : ['python3'])
- endif
-
- if not (bpython3dep.found())
- bpython3dep = disabler()
+ bpython3dep = dependency('boost', modules : ['python3'], required: false, disabler: true)
endif
else
python3dep = disabler()
diff --git a/test cases/frameworks/6 gettext/meson.build b/test cases/frameworks/6 gettext/meson.build
index 09ef982..afa24b1 100644
--- a/test cases/frameworks/6 gettext/meson.build
+++ b/test cases/frameworks/6 gettext/meson.build
@@ -5,6 +5,11 @@ if not gettext.found()
error('MESON_SKIP_TEST gettext not found.')
endif
+xgettext = find_program('xgettext', required: false)
+if not xgettext.found()
+ error('MESON_SKIP_TEST xgettext not found.')
+endif
+
if not meson.get_compiler('c').has_header('libintl.h')
error('MESON_SKIP_TEST libintl.h not found.')
endif
diff --git a/test cases/frameworks/7 gnome/meson.build b/test cases/frameworks/7 gnome/meson.build
index 03335b8..e7ba565 100644
--- a/test cases/frameworks/7 gnome/meson.build
+++ b/test cases/frameworks/7 gnome/meson.build
@@ -5,6 +5,11 @@ if not glib.found()
error('MESON_SKIP_TEST glib not found.')
endif
+gir = dependency('gobject-introspection-1.0', required: false)
+if not gir.found()
+ error('MESON_SKIP_TEST gobject-introspection not found.')
+endif
+
python3 = import('python3')
py3 = python3.find_python()
if run_command(py3, '-c', 'import gi;').returncode() != 0