From d2ea2c0df3399a55d96274d34b85aa41a775bf10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bence=20Sz=C3=A9pk=C3=BAti?= Date: Mon, 25 Oct 2021 20:58:14 +0200 Subject: [PATCH] Indicate errors interleaved with test suite output MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Indicate whether a success or failure is unexpected, or expected and ignored as they happen. Signed-off-by: Bence Szépkúti --- tests/scripts/test_psa_compliance.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/scripts/test_psa_compliance.py b/tests/scripts/test_psa_compliance.py index d6fe8c4407..aa0a480e5c 100755 --- a/tests/scripts/test_psa_compliance.py +++ b/tests/scripts/test_psa_compliance.py @@ -52,7 +52,7 @@ def main(): proc = subprocess.Popen(['./psa-arch-tests-crypto'], bufsize=1, stdout=subprocess.PIPE, universal_newlines=True) - test_re = re.compile('^TEST(?:: ([0-9]*)| RESULT: FAILED)') + test_re = re.compile('^TEST(?:: ([0-9]*)| RESULT: (FAILED|PASSED))') test = -1 unexpected_successes = set(EXPECTED_FAILURES) expected_failures = [] @@ -63,12 +63,16 @@ def main(): if match is not None: if match.group(1) is not None: test = int(match.group(1)) - else: + elif match.group(2) == 'FAILED': try: unexpected_successes.remove(test) expected_failures.append(test) + print('Expected failure, ignoring') except KeyError: unexpected_failures.append(test) + print('ERROR: Unexpected failure') + elif test in unexpected_successes: + print('ERROR: Unexpected success') proc.wait() print()