]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[contrib] validate_failures.py: Improve error output
authorThiago Bauermann <thiago.bauermann@linaro.org>
Thu, 1 Jun 2023 12:25:18 +0000 (12:25 +0000)
committerMaxim Kuvyrkov <maxim.kuvyrkov@linaro.org>
Wed, 14 Jun 2023 14:29:47 +0000 (14:29 +0000)
- 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/ChangeLog:

* testsuite-management/validate_failures.py (TestResult): Improve error
output.

contrib/testsuite-management/validate_failures.py

index 6dcdcf5c69b6cdec94d7562b4642a3519db083ac..1919935cf537af92a82a23a2592bee80f88974e8 100755 (executable)
@@ -136,12 +136,15 @@ class TestResult(object):
          self.name,
          self.description) = _VALID_TEST_RESULTS_REX.match(summary_line).groups()
       except:
-        print('Failed to parse summary line: "%s"' % summary_line)
+        print('Failed to parse summary line: "%s"' % summary_line,
+              file=sys.stderr)
         raise
       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)
         raise
       self.tool = tool
       self.exp = exp