| OLD | NEW |
| 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 /// An entry found in the test.py logs corresponding to a test failure. | 5 /// An entry found in the test.py logs corresponding to a test failure. |
| 6 /// | 6 /// |
| 7 /// It stores what suite, test, and configuration was the failure seen at. | 7 /// It stores what suite, test, and configuration was the failure seen at. |
| 8 library status_files.record; | 8 library status_files.record; |
| 9 | 9 |
| 10 class Record implements Comparable<Record> { | 10 class Record implements Comparable<Record> { |
| 11 final String suite; | 11 final String suite; |
| 12 final String test; | 12 final String test; |
| 13 final String config; | 13 final String config; |
| 14 final String expected; | 14 final String expected; |
| 15 final String actual; | 15 final String actual; |
| 16 final String repro; | 16 final String repro; |
| 17 final String reason; | 17 final String reason; |
| 18 final String fullReason; |
| 19 final List<String> stack; |
| 18 | 20 |
| 19 // TODO(sigmund): extract also a failure reason if any (e.g. a stack trace or | 21 // TODO(sigmund): extract also a failure reason if any (e.g. a stack trace or |
| 20 // error message for crashes). | 22 // error message for crashes). |
| 21 | 23 |
| 22 bool get isPassing => actual == 'Pass'; | 24 bool get isPassing => actual == 'Pass'; |
| 23 | 25 |
| 24 Record(this.suite, this.test, this.config, this.expected, this.actual, | 26 Record(this.suite, this.test, this.config, this.expected, this.actual, |
| 25 this.reason, this.repro); | 27 this.reason, this.repro, this.fullReason, this.stack); |
| 26 | 28 |
| 27 int compareTo(Record other) { | 29 int compareTo(Record other) { |
| 28 if (suite == null && other.suite != null) return -1; | 30 if (suite == null && other.suite != null) return -1; |
| 29 if (suite != null && other.suite == null) return 1; | 31 if (suite != null && other.suite == null) return 1; |
| 30 if (test == null && other.test != null) return -1; | 32 if (test == null && other.test != null) return -1; |
| 31 if (test != null && other.test == null) return 1; | 33 if (test != null && other.test == null) return 1; |
| 32 | 34 |
| 33 var suiteDiff = suite.compareTo(other.suite); | 35 var suiteDiff = suite.compareTo(other.suite); |
| 34 if (suiteDiff != 0) return suiteDiff; | 36 if (suiteDiff != 0) return suiteDiff; |
| 35 | 37 |
| 36 if (isPassing && !other.isPassing) return -1; | 38 if (isPassing && !other.isPassing) return -1; |
| 37 if (!isPassing && other.isPassing) return 1; | 39 if (!isPassing && other.isPassing) return 1; |
| 38 | 40 |
| 39 var testDiff = test.compareTo(other.test); | 41 var testDiff = test.compareTo(other.test); |
| 40 if (testDiff != 0) return testDiff; | 42 if (testDiff != 0) return testDiff; |
| 41 return repro.compareTo(other.repro); | 43 return repro.compareTo(other.repro); |
| 42 } | 44 } |
| 43 | 45 |
| 44 bool operator ==(covariant Record other) => | 46 bool operator ==(covariant Record other) => |
| 45 suite == other.suite && | 47 suite == other.suite && |
| 46 test == other.test && | 48 test == other.test && |
| 47 config == other.config && | 49 config == other.config && |
| 48 expected == other.expected && | 50 expected == other.expected && |
| 49 actual == other.actual && | 51 actual == other.actual && |
| 50 repro == other.repro; | 52 repro == other.repro; |
| 51 } | 53 } |
| OLD | NEW |