diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2019-01-01 19:27:41 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-01 19:27:41 +0200 |
commit | 8c9fcb1feac8ef7e4064ede9035f76ad53dc8e09 (patch) | |
tree | 5fc28dbf7d81db0ba1072ffe32737ff9138d1bb6 /run_unittests.py | |
parent | 739341ec045a42892b454f59f76515f73c2a8759 (diff) | |
parent | 98115bb26150866f5b44b744b4b4dbadd37117ba (diff) | |
download | meson-8c9fcb1feac8ef7e4064ede9035f76ad53dc8e09.zip meson-8c9fcb1feac8ef7e4064ede9035f76ad53dc8e09.tar.gz meson-8c9fcb1feac8ef7e4064ede9035f76ad53dc8e09.tar.bz2 |
Merge pull request #4564 from mensinda/introBuildOpts
mintro: Introspect --buildoptions without a build directory
Diffstat (limited to 'run_unittests.py')
-rwxr-xr-x | run_unittests.py | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/run_unittests.py b/run_unittests.py index ec1af0f..07e6bf9 100755 --- a/run_unittests.py +++ b/run_unittests.py @@ -1199,7 +1199,12 @@ class BasePlatformTests(unittest.TestCase): args = [args] out = subprocess.check_output(self.mintro_command + args + [directory], universal_newlines=True) - return json.loads(out) + try: + obj = json.loads(out) + except Exception as e: + print(out) + raise e + return obj def assertPathEqual(self, path1, path2): ''' @@ -3089,6 +3094,16 @@ recommended as it is not supported on some platforms''') self.assertEqual(Path(testfile).read_text(), Path(goodfile).read_text()) + def test_introspect_buildoptions_without_configured_build(self): + testdir = os.path.join(self.unit_test_dir, '51 introspect buildoptions') + testfile = os.path.join(testdir, 'meson.build') + res_nb = self.introspect_directory(testfile, ['--buildoptions'] + self.meson_args) + self.init(testdir, default_args=False) + res_wb = self.introspect('--buildoptions') + self.maxDiff = None + self.assertListEqual(res_nb, res_wb) + + class FailureTests(BasePlatformTests): ''' Tests that test failure conditions. Build files here should be dynamically |