diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2019-12-18 01:17:27 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-12-18 01:17:27 +0200 |
commit | 3122bac28a1e047da28b0190b8a0610cc26028dc (patch) | |
tree | ae4d0edb64d53f8e729bc586a6038286cedb215b /run_unittests.py | |
parent | a2a9611e1de9313770cc2ef8d6a363da6d8eb6dc (diff) | |
parent | a4bb0928e30ac6464a8ef5003df43233d61d6bdf (diff) | |
download | meson-3122bac28a1e047da28b0190b8a0610cc26028dc.zip meson-3122bac28a1e047da28b0190b8a0610cc26028dc.tar.gz meson-3122bac28a1e047da28b0190b8a0610cc26028dc.tar.bz2 |
Merge pull request #4649 from dcbaker/summary-function
Add a summary() function for configuration summarization
Diffstat (limited to 'run_unittests.py')
-rwxr-xr-x | run_unittests.py | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/run_unittests.py b/run_unittests.py index 977a4f8..78de65f 100755 --- a/run_unittests.py +++ b/run_unittests.py @@ -4142,6 +4142,40 @@ 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 + + string: bar + integer: 1 + boolean: True + + My Project 1.0 + + Configuration + Some boolean: False + Another boolean: True + Some string: Hello World + A list: string + 1 + True + A number: 1 + yes: YES + no: NO + ''') + # 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 |