aboutsummaryrefslogtreecommitdiff
path: root/run_unittests.py
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2018-05-09 21:04:55 +0530
committerNirbheek Chauhan <nirbheek@centricular.com>2018-05-09 21:04:55 +0530
commit86cc4f27072bede2a6f7ed2879b2786529e3204f (patch)
tree354ff2856032aa12ff9ee427a10e23d617cfcacb /run_unittests.py
parent7ca2b8caca240184ed64180a7b56d74639e68c78 (diff)
downloadmeson-86cc4f27072bede2a6f7ed2879b2786529e3204f.zip
meson-86cc4f27072bede2a6f7ed2879b2786529e3204f.tar.gz
meson-86cc4f27072bede2a6f7ed2879b2786529e3204f.tar.bz2
gdbus_codegen: Guess the output list for docbook generation
We were setting it to a file list that would always be wrong, and always out of date since it would never exist. However, the output list is not predictable. It usually has a 1-1 relationship with the input XML files, but it may not. This must be fixed later with API for users to provide the output names. See: https://github.com/mesonbuild/meson/pull/3539
Diffstat (limited to 'run_unittests.py')
-rwxr-xr-xrun_unittests.py18
1 files changed, 16 insertions, 2 deletions
diff --git a/run_unittests.py b/run_unittests.py
index 78bb9b7..94c14da 100755
--- a/run_unittests.py
+++ b/run_unittests.py
@@ -688,8 +688,10 @@ class BasePlatformTests(unittest.TestCase):
cmds = [l[len(prefix):].split() for l in log if l.startswith(prefix)]
return cmds
- def introspect(self, arg):
- out = subprocess.check_output(self.mintro_command + [arg, self.builddir],
+ def introspect(self, args):
+ if isinstance(args, str):
+ args = [args]
+ out = subprocess.check_output(self.mintro_command + args + [self.builddir],
universal_newlines=True)
return json.loads(out)
@@ -2938,6 +2940,18 @@ class LinuxlikeTests(BasePlatformTests):
gobject_found = True
self.assertTrue(glib_found)
self.assertTrue(gobject_found)
+ if subprocess.call(['pkg-config', '--exists', 'glib-2.0 >= 2.56.2']) != 0:
+ raise unittest.SkipTest('glib >= 2.56.2 needed for the rest')
+ targets = self.introspect('--targets')
+ docbook_target = None
+ for t in targets:
+ if t['name'] == 'generated-gdbus-docbook':
+ docbook_target = t
+ break
+ self.assertIsInstance(docbook_target, dict)
+ ifile = self.introspect(['--target-files', 'generated-gdbus-docbook@cus'])[0]
+ self.assertEqual(t['filename'], 'gdbus/generated-gdbus-doc-' + ifile)
+
def test_build_rpath(self):
if is_cygwin():