Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(54)

Unified Diff: pkg/compiler/tool/status_files/record.dart

Issue 2996533002: Add utility tool to update .status files automatically (Closed)
Patch Set: remove editbuffer Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/compiler/tool/status_files/log_parser.dart ('k') | pkg/compiler/tool/status_files/update_all.sh » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/tool/status_files/record.dart
diff --git a/pkg/compiler/tool/status_files/record.dart b/pkg/compiler/tool/status_files/record.dart
new file mode 100644
index 0000000000000000000000000000000000000000..1162978a8befc711106573db351ccb575d27cdf1
--- /dev/null
+++ b/pkg/compiler/tool/status_files/record.dart
@@ -0,0 +1,50 @@
+// Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+/// An entry found in the test.py logs corresponding to a test failure.
+///
+/// It stores what suite, test, and configuration was the failure seen at.
+library status_files.record;
+
+class Record implements Comparable<Record> {
+ final String suite;
+ final String test;
+ final String config;
+ final String expected;
+ final String actual;
+ final String repro;
+
+ // TODO(sigmund): extract also a failure reason if any (e.g. a stack trace or
+ // error message for crashes).
+
+ bool get isPassing => actual == 'Pass';
+
+ Record(this.suite, this.test, this.config, this.expected, this.actual,
+ this.repro);
+
+ int compareTo(Record other) {
+ if (suite == null && other.suite != null) return -1;
+ if (suite != null && other.suite == null) return 1;
+ if (test == null && other.test != null) return -1;
+ if (test != null && other.test == null) return 1;
+
+ var suiteDiff = suite.compareTo(other.suite);
+ if (suiteDiff != 0) return suiteDiff;
+
+ if (isPassing && !other.isPassing) return -1;
+ if (!isPassing && other.isPassing) return 1;
+
+ var testDiff = test.compareTo(other.test);
+ if (testDiff != 0) return testDiff;
+ return repro.compareTo(other.repro);
+ }
+
+ bool operator ==(covariant Record other) =>
+ suite == other.suite &&
+ test == other.test &&
+ config == other.config &&
+ expected == other.expected &&
+ actual == other.actual &&
+ repro == other.repro;
+}
« no previous file with comments | « pkg/compiler/tool/status_files/log_parser.dart ('k') | pkg/compiler/tool/status_files/update_all.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698