[09/12,contrib] validate_failures.py: Improve error output

Message ID 20230602152052.1874860-10-maxim.kuvyrkov@linaro.org
State Committed
Commit 7aa47751d23ceaf7a7fa746e30dc3266f6c40ad3
Series [01/12,contrib] validate_failures.py: Avoid testsuite aliasing |


Context Check Description
linaro-tcwg-bot/tcwg_gcc_build--master-arm success Testing passed
linaro-tcwg-bot/tcwg_gcc_build--master-aarch64 success Testing passed
linaro-tcwg-bot/tcwg_gcc_check--master-aarch64 success Testing passed
linaro-tcwg-bot/tcwg_gcc_check--master-arm success Testing passed

Commit Message

Maxim Kuvyrkov June 2, 2023, 3:20 p.m. UTC
  From: Thiago Bauermann <thiago.bauermann@linaro.org>

- Print message in case of broken sum file error.
- Print error messages to stderr.  The script's stdout is, usually,
  redirected to a file, and error messages shouldn't go there.
 contrib/testsuite-management/validate_failures.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)


diff --git a/contrib/testsuite-management/validate_failures.py b/contrib/testsuite-management/validate_failures.py
index 6dcdcf5c69b..1919935cf53 100755
--- a/contrib/testsuite-management/validate_failures.py
+++ b/contrib/testsuite-management/validate_failures.py
@@ -136,12 +136,15 @@  class TestResult(object):
          self.description) = _VALID_TEST_RESULTS_REX.match(summary_line).groups()
-        print('Failed to parse summary line: "%s"' % summary_line)
+        print('Failed to parse summary line: "%s"' % summary_line,
+              file=sys.stderr)
       self.ordinal = ordinal
       if tool == None or exp == None:
         # .sum file seem to be broken.  There was no "tool" and/or "exp"
         # lines preceding this result.
+        print(f'.sum file seems to be broken: tool="{tool}", exp="{exp}", summary_line="{summary_line}"',
+              file=sys.stderr)
       self.tool = tool
       self.exp = exp