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

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

Issue 8437048: Dart rewrite of test scripts: do not fail test on missing status file. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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 | « no previous file | 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("^[^#]*");
(...skipping 12 matching lines...) Expand all
23 23
24 24
25 // Helper method to be able to run the test from the runtime 25 // Helper method to be able to run the test from the runtime
26 // directory, or the top directory. 26 // directory, or the top directory.
27 String getFilename(String path) => 27 String getFilename(String path) =>
28 new File(path).existsSync() ? path : '../$path'; 28 new File(path).existsSync() ? path : '../$path';
29 29
30 30
31 void ReadConfigurationInto(path, sections) { 31 void ReadConfigurationInto(path, sections) {
32 File file = new File(getFilename(path)); 32 File file = new File(getFilename(path));
33 Expect.isTrue(file.existsSync()); // TODO(whesse): Handle missing file. 33 if (!file.existsSync()) return; // TODO(whesse): Handle missing file.
Mads Ager (google) 2011/11/02 10:47:34 This seems like the wrong fix. Please change the t
34 FileInputStream file_stream = file.openInputStream(); 34 FileInputStream file_stream = file.openInputStream();
35 StringInputStream lines = new StringInputStream(file_stream); 35 StringInputStream lines = new StringInputStream(file_stream);
36 36
37 Section current = new Section.always(); 37 Section current = new Section.always();
38 sections.add(current); 38 sections.add(current);
39 String prefix = ""; 39 String prefix = "";
40 40
41 String line; 41 String line;
42 while ((line = lines.readLine()) != null) { 42 while ((line = lines.readLine()) != null) {
43 Match match = StripComment.firstMatch(line); 43 Match match = StripComment.firstMatch(line);
(...skipping 27 matching lines...) Expand all
71 prefix = match[1]; 71 prefix = match[1];
72 continue; 72 continue;
73 } 73 }
74 74
75 print("unmatched line: $line"); 75 print("unmatched line: $line");
76 } 76 }
77 77
78 file_stream.close(); 78 file_stream.close();
79 } 79 }
80 80
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698