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

Unified Diff: tools/testing/dart/status_file_parser.dart

Issue 12559013: Revert "Update the test runner to use the new dart:io API" again (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 9 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 | « tools/testing/dart/multitest.dart ('k') | tools/testing/dart/test_options.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/testing/dart/status_file_parser.dart
diff --git a/tools/testing/dart/status_file_parser.dart b/tools/testing/dart/status_file_parser.dart
index dc3d5fe4e475bfa30383061e0bbaa78807a89bb6..d314581fb6e18cef96dca3d1c213538304ad9941 100644
--- a/tools/testing/dart/status_file_parser.dart
+++ b/tools/testing/dart/status_file_parser.dart
@@ -4,7 +4,6 @@
library status_file_parser;
-import "dart:async";
import "dart:io";
import "status_expression.dart";
@@ -66,45 +65,49 @@ void ReadConfigurationInto(path, sections, onDone) {
if (!file.existsSync()) {
throw new Exception('Cannot find test status file $path');
}
- Stream<String> lines =
- file.openRead()
- .transform(new StringDecoder())
- .transform(new LineTransformer());
+ InputStream file_stream = file.openInputStream();
+ StringInputStream lines = new StringInputStream(file_stream);
Section current = new Section.always();
sections.add(current);
- lines.listen((String line) {
- Match match = StripComment.firstMatch(line);
- line = (match == null) ? "" : match[0];
- line = line.trim();
- if (line.isEmpty) return;
-
- match = HeaderPattern.firstMatch(line);
- if (match != null) {
- String condition_string = match[1].trim();
- List<String> tokens = new Tokenizer(condition_string).tokenize();
- ExpressionParser parser = new ExpressionParser(new Scanner(tokens));
- current = new Section(parser.parseBooleanExpression());
- sections.add(current);
- return;
- }
+ lines.onLine = () {
+ String line;
+ while ((line = lines.readLine()) != null) {
+ Match match = StripComment.firstMatch(line);
+ line = (match == null) ? "" : match[0];
+ line = line.trim();
+ if (line.isEmpty) continue;
+
+ match = HeaderPattern.firstMatch(line);
+ if (match != null) {
+ String condition_string = match[1].trim();
+ List<String> tokens = new Tokenizer(condition_string).tokenize();
+ ExpressionParser parser = new ExpressionParser(new Scanner(tokens));
+ current = new Section(parser.parseBooleanExpression());
+ sections.add(current);
+ continue;
+ }
- match = RulePattern.firstMatch(line);
- if (match != null) {
- String name = match[1].trim();
- // TODO(whesse): Handle test names ending in a wildcard (*).
- String expression_string = match[2].trim();
- List<String> tokens = new Tokenizer(expression_string).tokenize();
- SetExpression expression =
- new ExpressionParser(new Scanner(tokens)).parseSetExpression();
- current.testRules.add(new TestRule(name, expression));
- return;
+ match = RulePattern.firstMatch(line);
+ if (match != null) {
+ String name = match[1].trim();
+ // TODO(whesse): Handle test names ending in a wildcard (*).
+ String expression_string = match[2].trim();
+ List<String> tokens = new Tokenizer(expression_string).tokenize();
+ SetExpression expression =
+ new ExpressionParser(new Scanner(tokens)).parseSetExpression();
+ current.testRules.add(new TestRule(name, expression));
+ continue;
+ }
+
+ print("unmatched line: $line");
}
+ };
- print("unmatched line: $line");
- },
- onDone: onDone);
+ lines.onClosed = () {
+ onDone();
+ };
}
« no previous file with comments | « tools/testing/dart/multitest.dart ('k') | tools/testing/dart/test_options.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698