aboutsummaryrefslogtreecommitdiff
path: root/run_unittests.py
diff options
context:
space:
mode:
authorXavier Claessens <xavier.claessens@collabora.com>2019-12-11 16:19:10 -0500
committerXavier Claessens <xavier.claessens@collabora.com>2019-12-12 18:30:17 -0500
commit6e865a233099a00e9ea08f6a2f911ede3c7b4215 (patch)
tree49f0e3f610cce931c9e75f54c2ee95092337e53a /run_unittests.py
parent17dd9e5bffd42c3ad6c2dff1f15639d6adf31e1c (diff)
downloadmeson-6e865a233099a00e9ea08f6a2f911ede3c7b4215.zip
meson-6e865a233099a00e9ea08f6a2f911ede3c7b4215.tar.gz
meson-6e865a233099a00e9ea08f6a2f911ede3c7b4215.tar.bz2
Add a summary() function for configuration summarization
Based on patch from Dylan Baker. Fixes #757
Diffstat (limited to 'run_unittests.py')
-rwxr-xr-xrun_unittests.py35
1 files changed, 35 insertions, 0 deletions
diff --git a/run_unittests.py b/run_unittests.py
index a7a0d26..9167d14 100755
--- a/run_unittests.py
+++ b/run_unittests.py
@@ -4113,6 +4113,41 @@ recommended as it is not supported on some platforms''')
self.init(testdir)
self._run(self.mconf_command + [self.builddir])
+ # FIXME: The test is failing on Windows CI even if the print looks good.
+ # Maybe encoding issue?
+ @unittest.skipIf(is_windows(), 'This test fails on Windows CI')
+ def test_summary(self):
+ testdir = os.path.join(self.unit_test_dir, '74 summary')
+ out = self.init(testdir)
+ expected = textwrap.dedent(r'''
+ Some Subproject 2.0
+
+ Features
+ foo: bar
+
+ My Project 1.0
+
+ Directories
+ bindir: bin
+ libdir: lib
+ datadir: share
+
+ Configuration
+ Some boolean: False
+ Another boolean: True
+ Some string: Hello World
+ A list: string
+ 1
+ True
+ ''')
+ # Dict ordering is not guaranteed and an exact string comparison randomly
+ # fails on the CI because lines are reordered.
+ expected_lines = expected.split('\n')[1:]
+ out_start = out.find(expected_lines[0])
+ out_lines = out[out_start:].split('\n')[:len(expected_lines)]
+ self.assertEqual(sorted(expected_lines), sorted(out_lines))
+
+
class FailureTests(BasePlatformTests):
'''
Tests that test failure conditions. Build files here should be dynamically