diff options
author | Daniel Mensinger <daniel@mensinger-ka.de> | 2018-11-27 22:27:34 +0100 |
---|---|---|
committer | Daniel Mensinger <daniel@mensinger-ka.de> | 2019-01-06 12:19:27 +0100 |
commit | 98eb7a48ab3de0122e8c5e8a188527d71a23a914 (patch) | |
tree | 6583f0ea12c60faa50dc97f596f2bc31f6572d84 | |
parent | b2854e9edc8da3d945b4e53f80afc4c9f7129fd4 (diff) | |
download | meson-98eb7a48ab3de0122e8c5e8a188527d71a23a914.zip meson-98eb7a48ab3de0122e8c5e8a188527d71a23a914.tar.gz meson-98eb7a48ab3de0122e8c5e8a188527d71a23a914.tar.bz2 |
Added unit test
-rw-r--r-- | mesonbuild/mintro.py | 2 | ||||
-rwxr-xr-x | run_unittests.py | 30 |
2 files changed, 31 insertions, 1 deletions
diff --git a/mesonbuild/mintro.py b/mesonbuild/mintro.py index 4f0e928..d372112 100644 --- a/mesonbuild/mintro.py +++ b/mesonbuild/mintro.py @@ -663,4 +663,4 @@ def generate_introspection_file(coredata, builddata, testdata, benchmarkdata, in outfile = os.path.abspath(outfile) with open(outfile, 'w') as fp: - json.dump(outdict, fp, indent=2) + json.dump(outdict, fp) diff --git a/run_unittests.py b/run_unittests.py index 9259b03..9088a86 100755 --- a/run_unittests.py +++ b/run_unittests.py @@ -3110,6 +3110,36 @@ recommended as it is not supported on some platforms''') self.maxDiff = None self.assertListEqual(res_nb, res_wb) + def test_introspect_all_command(self): + testdir = os.path.join(self.common_test_dir, '6 linkshared') + self.init(testdir) + res = self.introspect('--all') + keylist = [ + 'benchmarks', + 'buildoptions', + 'buildsystem_files', + 'dependencies', + 'installed', + 'projectinfo', + 'targets', + 'tests' + ] + + for i in keylist: + self.assertIn(i, res) + + def test_introspect_file_dump_eauals_all(self): + testdir = os.path.join(self.common_test_dir, '6 linkshared') + self.init(testdir) + res_all = self.introspect('--all') + res_file = {} + + introfile = os.path.join(self.builddir, 'meson-introspection.json') + self.assertPathExists(introfile) + with open(introfile, 'r') as fp: + res_file = json.load(fp) + + self.assertEqual(res_all, res_file) class FailureTests(BasePlatformTests): ''' |