aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mesonbuild/mintro.py2
-rwxr-xr-xrun_unittests.py30
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):
'''