public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r14-1822] [contrib] validate_failures.py: Ignore stray filesystem paths in results
@ 2023-06-14 14:31 Maxim Kuvyrkov
0 siblings, 0 replies; only message in thread
From: Maxim Kuvyrkov @ 2023-06-14 14:31 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:9ef1391d86be504226ed446b9c29024f2c1d5045
commit r14-1822-g9ef1391d86be504226ed446b9c29024f2c1d5045
Author: Maxim Kuvyrkov <maxim.kuvyrkov@linaro.org>
Date: Fri Jun 2 14:51:40 2023 +0000
[contrib] validate_failures.py: Ignore stray filesystem paths in results
This patch simplifies comparison of results that have filesystem
paths. E.g., (assuming different values of <N>):
<cut>
Running /home/user/gcc-N/gcc/testsuite/gcc.target/aarch64/sve/acle/aarch64-sve-acle-asm.exp ...
ERROR: tcl error sourcing /home/user/gcc-N/gcc/testsuite/gcc.target/aarch64/sve/acle/aarch64-sve-acle-asm.exp.
</cut>
We add "--srcpath <regex>", option, and set it by default to
"[^ ]+/testsuite/", which works well for all components of the GNU
Toolchain. We then remove substrings matching <regex> from paths of
.exp files and from occasional "ERROR:" results.
contrib/ChangeLog:
* testsuite-management/validate_failures.py (TestResult,)
(ParseManifestWorker, ParseSummary, Main): Handle new option
"--srcpath <regex>".
Diff:
---
contrib/testsuite-management/validate_failures.py | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/contrib/testsuite-management/validate_failures.py b/contrib/testsuite-management/validate_failures.py
index a77aabe0bdd..4dfd9cda4e2 100755
--- a/contrib/testsuite-management/validate_failures.py
+++ b/contrib/testsuite-management/validate_failures.py
@@ -135,6 +135,9 @@ class TestResult(object):
(self.state,
self.name,
self.description) = _VALID_TEST_RESULTS_REX.match(summary_line).groups()
+ if _OPTIONS.srcpath_regex and _OPTIONS.srcpath_regex != '':
+ self.description = re.sub(_OPTIONS.srcpath_regex, '',
+ self.description)
except:
print('Failed to parse summary line: "%s"' % summary_line,
file=sys.stderr)
@@ -361,6 +364,9 @@ def ParseManifestWorker(result_set, manifest_path):
result_set.add(result)
elif IsExpLine(orig_line):
result_set.current_exp = _EXP_LINE_REX.match(orig_line).groups()[0]
+ if _OPTIONS.srcpath_regex and _OPTIONS.srcpath_regex != '':
+ result_set.current_exp = re.sub(_OPTIONS.srcpath_regex, '',
+ result_set.current_exp)
elif IsToolLine(orig_line):
result_set.current_tool = _TOOL_LINE_REX.match(orig_line).groups()[0]
elif IsSummaryLine(orig_line):
@@ -400,6 +406,9 @@ def ParseSummary(sum_fname):
result_set.add(result)
elif IsExpLine(line):
result_set.current_exp = _EXP_LINE_REX.match(line).groups()[0]
+ if _OPTIONS.srcpath_regex and _OPTIONS.srcpath_regex != '':
+ result_set.current_exp = re.sub(_OPTIONS.srcpath_regex, '',
+ result_set.current_exp)
result_set.testsuites.add((result_set.current_tool,
result_set.current_exp))
elif IsToolLine(line):
@@ -640,6 +649,12 @@ def Main(argv):
help='Use provided date YYYYMMDD to decide whether '
'manifest entries with expiry settings have expired '
'or not. (default = Use today date)')
+ parser.add_option('--srcpath', action='store', type='string',
+ dest='srcpath_regex', default='[^ ]+/testsuite/',
+ help='Remove provided path (can be a regex) from '
+ 'the result entries. This is useful to remove '
+ 'occasional filesystem path from the results. '
+ '(default = "[^ ]+/testsuite/")')
parser.add_option('--inverse_match', action='store_true',
dest='inverse_match', default=False,
help='Inverse result sets in comparison. '
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-06-14 14:31 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-14 14:31 [gcc r14-1822] [contrib] validate_failures.py: Ignore stray filesystem paths in results Maxim Kuvyrkov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).