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

Side by Side Diff: tools/testing/dart/status_file_parser.dart

Issue 8507010: Make tools/test.dart read standalone.status status file when running tests. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Remove unimplemented stubs and classes. Created 9 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « tests/standalone/test_config.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 #library("status_file_parser"); 5 #library("status_file_parser");
6 6
7 7
8 #import("status_expression.dart"); 8 #import("status_expression.dart");
9 9
10 final RegExp StripComment = const RegExp("^[^#]*"); 10 final RegExp StripComment = const RegExp("^[^#]*");
11 final RegExp HeaderPattern = const RegExp(@"\[([^\]]+)\]"); 11 final RegExp HeaderPattern = const RegExp(@"\[([^\]]+)\]");
12 final RegExp RulePattern = const RegExp(@"\s*([^: ]*)\s*:(.*)"); 12 final RegExp RulePattern = const RegExp(@"\s*([^: ]*)\s*:(.*)");
13 final RegExp PrefixPattern = const RegExp(@"^\s*prefix\s+([\w\_\.\-\/]+)\s*$"); 13 final RegExp PrefixPattern = const RegExp(@"^\s*prefix\s+([\w\_\.\-\/]+)\s*$");
14 14
15 // TODO(whesse): Implement configuration_info library that contains data 15 // TODO(whesse): Implement configuration_info library that contains data
16 // structures for test configuration, including Section. 16 // structures for test configuration, including Section.
17 class Section { 17 class Section {
18 BooleanExpression condition; 18 BooleanExpression condition;
19 Collection testSettings = const [];
19 20
20 Section.always() : condition = null; 21 Section.always() : condition = null;
21 Section(this.condition); 22 Section(this.condition);
22 } 23 }
23 24
24 25
25 // Helper method to be able to run the test from the runtime 26 // Helper method to be able to run the test from the runtime
26 // directory, or the top directory. 27 // directory, or the top directory.
27 String getFilename(String path) => 28 String getFilename(String path) =>
28 new File(path).existsSync() ? path : '../$path'; 29 new File(path).existsSync() ? path : '../$path';
29 30
31 String getDirname(String path) =>
32 new Directory(path).existsSync() ? path : '../$path';
33
30 34
31 void ReadConfigurationInto(path, sections) { 35 void ReadConfigurationInto(path, sections) {
32 File file = new File(getFilename(path)); 36 File file = new File(getFilename(path));
33 if (!file.existsSync()) return; // TODO(whesse): Handle missing file. 37 if (!file.existsSync()) return; // TODO(whesse): Handle missing file.
34 FileInputStream file_stream = file.openInputStream(); 38 FileInputStream file_stream = file.openInputStream();
35 StringInputStream lines = new StringInputStream(file_stream); 39 StringInputStream lines = new StringInputStream(file_stream);
36 40
37 Section current = new Section.always(); 41 Section current = new Section.always();
38 sections.add(current); 42 sections.add(current);
39 String prefix = ""; 43 String prefix = "";
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 prefix = match[1]; 75 prefix = match[1];
72 continue; 76 continue;
73 } 77 }
74 78
75 print("unmatched line: $line"); 79 print("unmatched line: $line");
76 } 80 }
77 81
78 file_stream.close(); 82 file_stream.close();
79 } 83 }
80 84
OLDNEW
« no previous file with comments | « tests/standalone/test_config.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698