From 0fcd696b1e0c6ff9ca462ac2f8e0d497bf11e2c5 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Tue, 7 Sep 2021 18:56:17 +0200 Subject: unittests: test external dependency in summary This requires a bit of extra code because the version might change, but otherwise it fits in the existing AllPlatformTests.test_summary testcase Signed-off-by: Paolo Bonzini --- unittests/allplatformstests.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'unittests/allplatformstests.py') diff --git a/unittests/allplatformstests.py b/unittests/allplatformstests.py index 6ead45e..c420340 100644 --- a/unittests/allplatformstests.py +++ b/unittests/allplatformstests.py @@ -3119,6 +3119,7 @@ class AllPlatformTests(BasePlatformTests): missing prog : NO existing prog : ''' + sys.executable + ''' missing dep : NO + external dep : YES 1.2.3 internal dep : YES Plugins @@ -3142,9 +3143,13 @@ class AllPlatformTests(BasePlatformTests): if sys.version_info < (3, 7, 0): # Dictionary order is not stable in Python <3.7, so sort the lines # while comparing - self.assertEqual(sorted(expected_lines), sorted(out_lines)) - else: - self.assertEqual(expected_lines, out_lines) + expected_lines = sorted(expected_lines) + out_lines = sorted(out_lines) + for e, o in zip(expected_lines, out_lines): + if e.startswith(' external dep'): + self.assertRegex(o, r'^ external dep : (YES [0-9.]*|NO)$') + else: + self.assertEqual(o, e) def test_meson_compile(self): """Test the meson compile command.""" -- cgit v1.1