diff options
author | devans <devans@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-11-28 19:23:31 +0000 |
---|---|---|
committer | devans <devans@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-11-28 19:23:31 +0000 |
commit | 4ac21e63ac1cc491e8ef58fd2cfd0043b3987318 (patch) | |
tree | 2cd9b9890df47fb721d1dd87ea72cb9f2b9bb95f /contrib | |
parent | e0000bb2e0c0e0a256ed415af067d7b9695cdb81 (diff) | |
download | gcc-4ac21e63ac1cc491e8ef58fd2cfd0043b3987318.tar.gz |
* testsuite-management/validate_failures.py: Record ordinal with
TestResult.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@193903 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/ChangeLog | 5 | ||||
-rwxr-xr-x | contrib/testsuite-management/validate_failures.py | 15 |
2 files changed, 17 insertions, 3 deletions
diff --git a/contrib/ChangeLog b/contrib/ChangeLog index c789984f87f..8bf6add3f8f 100644 --- a/contrib/ChangeLog +++ b/contrib/ChangeLog @@ -1,3 +1,8 @@ +2012-11-28 Doug Evans <dje@google.com> + + * testsuite-management/validate_failures.py: Record ordinal with + TestResult. + 2012-11-19 Mike Stump <mikestump@comcast.net> * compare_tests: Add export LC_ALL=C to make sort happier. diff --git a/contrib/testsuite-management/validate_failures.py b/contrib/testsuite-management/validate_failures.py index 739193715cb..d78a54f860b 100755 --- a/contrib/testsuite-management/validate_failures.py +++ b/contrib/testsuite-management/validate_failures.py @@ -91,9 +91,12 @@ class TestResult(object): state: One of UNRESOLVED, XPASS or FAIL. name: File name for the test. description: String describing the test (flags used, dejagnu message, etc) + ordinal: Monotonically increasing integer. + It is used to keep results for one .exp file sorted + by the order the tests were run. """ - def __init__(self, summary_line): + def __init__(self, summary_line, ordinal=-1): try: self.attrs = '' if '|' in summary_line: @@ -109,6 +112,7 @@ class TestResult(object): self.attrs = self.attrs.strip() self.state = self.state.strip() self.description = self.description.strip() + self.ordinal = ordinal except ValueError: Error('Cannot parse summary line "%s"' % summary_line) @@ -117,7 +121,8 @@ class TestResult(object): self.state, summary_line, self)) def __lt__(self, other): - return self.name < other.name + return (self.name < other.name or + (self.name == other.name and self.ordinal < other.ordinal)) def __hash__(self): return hash(self.state) ^ hash(self.name) ^ hash(self.description) @@ -196,10 +201,14 @@ def IsInterestingResult(line): def ParseSummary(sum_fname): """Create a set of TestResult instances from the given summary file.""" result_set = set() + # ordinal is used when sorting the results so that tests within each + # .exp file are kept sorted. + ordinal=0 sum_file = open(sum_fname) for line in sum_file: if IsInterestingResult(line): - result = TestResult(line) + result = TestResult(line, ordinal) + ordinal += 1 if result.HasExpired(): # Tests that have expired are not added to the set of expected # results. If they are still present in the set of actual results, |