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

Side by Side Diff: pkg/compiler/tool/status_files/log_parser.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 unified diff | Download patch
« no previous file with comments | « no previous file | pkg/compiler/tool/status_files/record.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // BSD-style license that can be found in the LICENSE file.
4
5 library status_files.log_parser;
6
7 import 'record.dart';
8
9 /// Extracts test records from a test.py [log].
10 List<Record> parse(String log) {
11 var records = [];
12 var suite;
13 var test;
14 var config;
15 var expected;
16 var actual;
17 bool reproIsNext = false;
18 for (var line in log.split('\n')) {
19 if (line.startsWith("FAILED: ")) {
20 int space = line.lastIndexOf(' ');
21 test = line.substring(space + 1).trim();
22 suite = '';
23 var slash = test.indexOf('/');
24 if (slash > 0) {
25 suite = test.substring(0, slash).trim();
26 test = test.substring(slash + 1).trim();
27 }
28 config = line
29 .substring("FAILED: ".length, space)
30 .replaceAll('release_ia32', '')
31 .replaceAll('release_x64', '');
32 }
33 if (line.startsWith("Expected: ")) {
34 expected = line.substring("Expected: ".length).trim();
35 }
36 if (line.startsWith("Actual: ")) {
37 actual = line.substring("Actual: ".length).trim();
38 }
39 if (reproIsNext) {
40 records
41 .add(new Record(suite, test, config, expected, actual, line.trim()));
42 suite = test = config = expected = actual = null;
43 reproIsNext = false;
44 }
45 if (line.startsWith("Short reproduction command (experimental):")) {
46 reproIsNext = true;
47 }
48 }
49 return records;
50 }
OLDNEW
« no previous file with comments | « no previous file | pkg/compiler/tool/status_files/record.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698