| 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 part of testrunner; |
| 6 |
| 5 /** | 7 /** |
| 6 * Read the contents of a file [fileName] into a [List] of [String]s. | 8 * Read the contents of a file [fileName] into a [List] of [String]s. |
| 7 * If the file does not exist and [errorIfNoFile] is true, throw an | 9 * If the file does not exist and [errorIfNoFile] is true, throw an |
| 8 * exception, else return an empty list. | 10 * exception, else return an empty list. |
| 9 */ | 11 */ |
| 10 List<String> getFileContents(String filename, bool errorIfNoFile) { | 12 List<String> getFileContents(String filename, bool errorIfNoFile) { |
| 11 File f = new File(filename); | 13 File f = new File(filename); |
| 12 if (!f.existsSync()) { | 14 if (!f.existsSync()) { |
| 13 if (errorIfNoFile) { | 15 if (errorIfNoFile) { |
| 14 throw new Exception('Config file $filename not found.'); | 16 throw new Exception('Config file $filename not found.'); |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 * Get the directory that testrunner lives in; we need it to import | 82 * Get the directory that testrunner lives in; we need it to import |
| 81 * support files into the generated scripts. | 83 * support files into the generated scripts. |
| 82 */ | 84 */ |
| 83 | 85 |
| 84 String get runnerDirectory() { | 86 String get runnerDirectory() { |
| 85 var libDirectory = makePathAbsolute(new Options().script); | 87 var libDirectory = makePathAbsolute(new Options().script); |
| 86 return libDirectory.substring(0, | 88 return libDirectory.substring(0, |
| 87 libDirectory.lastIndexOf(Platform.pathSeparator)); | 89 libDirectory.lastIndexOf(Platform.pathSeparator)); |
| 88 } | 90 } |
| 89 | 91 |
| OLD | NEW |