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

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

Issue 2999753002: Collate stacks in test output (Closed)
Patch Set: 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
Index: pkg/compiler/tool/status_files/log_parser.dart
diff --git a/pkg/compiler/tool/status_files/log_parser.dart b/pkg/compiler/tool/status_files/log_parser.dart
index 33d50f4197bec0b9ddfc17b57f09b9cf226926fd..0b082681be41da8e3376d571bf34690e1ffde6dc 100644
--- a/pkg/compiler/tool/status_files/log_parser.dart
+++ b/pkg/compiler/tool/status_files/log_parser.dart
@@ -6,6 +6,8 @@ library status_files.log_parser;
import 'record.dart';
+final RegExp _stackRE = new RegExp('#[0-9]* ');
+
/// Extracts test records from a test.py [log].
List<Record> parse(String log) {
var records = [];
@@ -15,6 +17,9 @@ List<Record> parse(String log) {
var expected;
var actual;
var reason;
+ var fullReason; // lines before stack, usually multiline reason.
+ var stack = [];
+ var paragraph = []; // collector forlines
Siggi Cherem (dart-lang) 2017/08/09 18:08:02 forlines? for fullReason?
sra1 2017/08/09 20:15:13 Done.
bool reproIsNext = false;
for (var line in log.split('\n')) {
if (line.startsWith("FAILED: ")) {
@@ -39,11 +44,24 @@ List<Record> parse(String log) {
}
if (line.startsWith("The compiler crashed:")) {
reason = line.substring("The compiler crashed:".length).trim();
+ paragraph.clear();
+ }
+
+ if (line.startsWith(_stackRE)) {
+ stack.add(line);
+ fullReason ??= paragraph.take(5).join('\n');
+ paragraph.clear();
+ } else {
+ paragraph.add(line);
}
+
if (reproIsNext) {
- records.add(new Record(
- suite, test, config, expected, actual, reason, line.trim()));
+ records.add(new Record(suite, test, config, expected, actual, reason,
+ line.trim(), fullReason, stack));
suite = test = config = expected = actual = reason = null;
+ stack = [];
+ fullReason = null;
+ paragraph.clear();
reproIsNext = false;
}
if (line.startsWith("Short reproduction command (experimental):")) {
« no previous file with comments | « no previous file | pkg/compiler/tool/status_files/record.dart » ('j') | pkg/compiler/tool/status_files/stacks.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698