| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 #import("dart:io"); | 7 #import("dart:io"); |
| 8 #import("status_expression.dart"); | 8 #import("status_expression.dart"); |
| 9 | 9 |
| 10 // Possible outcomes of running a test. | 10 // Possible outcomes of running a test. |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 } | 49 } |
| 50 } | 50 } |
| 51 onDone(); | 51 onDone(); |
| 52 } | 52 } |
| 53 | 53 |
| 54 ReadConfigurationInto(statusFilePath, sections, sectionsRead); | 54 ReadConfigurationInto(statusFilePath, sections, sectionsRead); |
| 55 } | 55 } |
| 56 | 56 |
| 57 void ReadConfigurationInto(path, sections, onDone) { | 57 void ReadConfigurationInto(path, sections, onDone) { |
| 58 File file = new File(path); | 58 File file = new File(path); |
| 59 if (!file.existsSync()) return; // TODO(whesse): Handle missing file. | 59 if (!file.existsSync()) { |
| 60 throw new Exception('Cannot find test status file $path'); |
| 61 } |
| 60 InputStream file_stream = file.openInputStream(); | 62 InputStream file_stream = file.openInputStream(); |
| 61 StringInputStream lines = new StringInputStream(file_stream); | 63 StringInputStream lines = new StringInputStream(file_stream); |
| 62 | 64 |
| 63 Section current = new Section.always(); | 65 Section current = new Section.always(); |
| 64 sections.add(current); | 66 sections.add(current); |
| 65 String prefix = ""; | 67 String prefix = ""; |
| 66 | 68 |
| 67 lines.lineHandler = () { | 69 lines.lineHandler = () { |
| 68 String line; | 70 String line; |
| 69 while ((line = lines.readLine()) != null) { | 71 while ((line = lines.readLine()) != null) { |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 } | 236 } |
| 235 regExps[i] = regExp; | 237 regExps[i] = regExp; |
| 236 } | 238 } |
| 237 _keyToRegExps[key] = regExps; | 239 _keyToRegExps[key] = regExps; |
| 238 }); | 240 }); |
| 239 | 241 |
| 240 _regExpCache = null; | 242 _regExpCache = null; |
| 241 _preprocessed = true; | 243 _preprocessed = true; |
| 242 } | 244 } |
| 243 } | 245 } |
| OLD | NEW |