aboutsummaryrefslogtreecommitdiff
path: root/run_unittests.py
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2018-02-19 23:06:37 +0530
committerJussi Pakkanen <jpakkane@gmail.com>2018-02-20 19:26:16 +0200
commit0c1c387703c04c8052161b7506c07f216329b232 (patch)
tree21c7c7a5213adac5e702be14f4d2f43fed053f56 /run_unittests.py
parent79865474c72b6b7ac32586b683644b78adfff778 (diff)
downloadmeson-0c1c387703c04c8052161b7506c07f216329b232.zip
meson-0c1c387703c04c8052161b7506c07f216329b232.tar.gz
meson-0c1c387703c04c8052161b7506c07f216329b232.tar.bz2
gnome: Fix depend_files listing for compile_resources
Also add a unit test that will test all codepaths for old Glib tools versions. Closes https://github.com/mesonbuild/meson/issues/2860
Diffstat (limited to 'run_unittests.py')
-rwxr-xr-xrun_unittests.py21
1 files changed, 20 insertions, 1 deletions
diff --git a/run_unittests.py b/run_unittests.py
index 3a66211..ac627da 100755
--- a/run_unittests.py
+++ b/run_unittests.py
@@ -33,6 +33,7 @@ import mesonbuild.compilers
import mesonbuild.environment
import mesonbuild.mesonlib
import mesonbuild.coredata
+import mesonbuild.modules.gnome
from mesonbuild.interpreter import ObjectHolder
from mesonbuild.mesonlib import (
is_linux, is_windows, is_osx, is_cygwin, is_dragonflybsd,
@@ -525,7 +526,10 @@ class BasePlatformTests(unittest.TestCase):
self.privatedir = os.path.join(self.builddir, 'meson-private')
if inprocess:
try:
- out = run_configure(self.meson_mainfile, self.meson_args + args + extra_args)[1]
+ (returncode, out, _) = run_configure(self.meson_mainfile, self.meson_args + args + extra_args)
+ if returncode != 0:
+ self._print_meson_log()
+ raise RuntimeError('Configure failed')
except:
self._print_meson_log()
raise
@@ -2598,6 +2602,21 @@ endian = 'little'
self.init(testdir)
self.build()
+ def test_old_gnome_module_codepaths(self):
+ '''
+ A lot of code in the GNOME module is conditional on the version of the
+ glib tools that are installed, and breakages in the old code can slip
+ by once the CI has a newer glib version. So we force the GNOME module
+ to pretend that it's running on an ancient glib so the fallback code is
+ also tested.
+ '''
+ testdir = os.path.join(self.framework_test_dir, '7 gnome')
+ os.environ['MESON_UNIT_TEST_PRETEND_GLIB_OLD'] = "1"
+ mesonbuild.modules.gnome.native_glib_version = '2.20'
+ self.init(testdir, inprocess=True)
+ self.build()
+ mesonbuild.modules.gnome.native_glib_version = None
+
class LinuxArmCrossCompileTests(BasePlatformTests):
'''