aboutsummaryrefslogtreecommitdiff
path: root/run_unittests.py
diff options
context:
space:
mode:
authorDaniel Schulte <trilader@schroedingers-bit.net>2019-01-30 21:30:52 +0100
committerJussi Pakkanen <jpakkane@gmail.com>2019-03-01 23:40:33 +0200
commitf0b0bcf86d195cc65918eea0de2c92083ac39f3f (patch)
treef04e32d6e39b904f0e1ea9a1db7dea02afb89c75 /run_unittests.py
parent924cf5e6220836be7ba9b53082948315497fce30 (diff)
downloadmeson-f0b0bcf86d195cc65918eea0de2c92083ac39f3f.zip
meson-f0b0bcf86d195cc65918eea0de2c92083ac39f3f.tar.gz
meson-f0b0bcf86d195cc65918eea0de2c92083ac39f3f.tar.bz2
mintro: Add subproject_dir to --projectinfo
Diffstat (limited to 'run_unittests.py')
-rwxr-xr-xrun_unittests.py16
1 files changed, 15 insertions, 1 deletions
diff --git a/run_unittests.py b/run_unittests.py
index dcd3ced..32c7875 100755
--- a/run_unittests.py
+++ b/run_unittests.py
@@ -3226,6 +3226,7 @@ recommended as it is not supported on some platforms''')
expected = {
'descriptive_name': 'proj',
'version': 'undefined',
+ 'subproject_dir': 'subprojects',
'subprojects': [
{
'descriptive_name': 'sub',
@@ -3251,6 +3252,19 @@ recommended as it is not supported on some platforms''')
name = entry['name']
self.assertEquals(entry['subproject'], expected[name])
+ def test_introspect_projectinfo_subproject_dir(self):
+ testdir = os.path.join(self.common_test_dir, '79 custom subproject dir')
+ self.init(testdir)
+ res = self.introspect('--projectinfo')
+
+ self.assertEqual(res['subproject_dir'], 'custom_subproject_dir')
+
+ def test_introspect_projectinfo_subproject_dir_from_source(self):
+ testfile = os.path.join(self.common_test_dir, '79 custom subproject dir', 'meson.build')
+ res = self.introspect_directory(testfile, '--projectinfo')
+
+ self.assertEqual(res['subproject_dir'], 'custom_subproject_dir')
+
@skipIfNoExecutable('clang-format')
def test_clang_format(self):
if self.backend is not Backend.ninja:
@@ -3404,7 +3418,7 @@ recommended as it is not supported on some platforms''')
self.assertListEqual(dependencies_to_find, [])
# Check projectinfo
- self.assertDictEqual(res['projectinfo'], {'version': '1.2.3', 'descriptive_name': 'introspection', 'subprojects': []})
+ self.assertDictEqual(res['projectinfo'], {'version': '1.2.3', 'descriptive_name': 'introspection', 'subproject_dir': 'subprojects', 'subprojects': []})
# Check targets
targets_to_find = {