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 multitest; | 5 library multitest; |
6 | 6 |
7 import "dart:async"; | 7 import "dart:async"; |
8 import "dart:io"; | 8 import "dart:io"; |
| 9 |
| 10 import "path.dart"; |
9 import "test_suite.dart"; | 11 import "test_suite.dart"; |
10 import "utils.dart"; | 12 import "utils.dart"; |
11 | 13 |
12 // Multitests are Dart test scripts containing lines of the form | 14 // Multitests are Dart test scripts containing lines of the form |
13 // " [some dart code] /// [key]: [error type]" | 15 // " [some dart code] /// [key]: [error type]" |
14 // | 16 // |
15 // For each key in the file, a new test file is made containing all | 17 // For each key in the file, a new test file is made containing all |
16 // the normal lines of the file, and all of the multitest lines containing | 18 // the normal lines of the file, and all of the multitest lines containing |
17 // that key, in the same order as in the source file. The new test is expected | 19 // that key, in the same order as in the source file. The new test is expected |
18 // to pass if the error type listed is 'ok', or to fail if there is an error | 20 // to pass if the error type listed is 'ok', or to fail if there is an error |
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
296 // TestSuite.forDirectory. | 298 // TestSuite.forDirectory. |
297 split.removeLast(); | 299 split.removeLast(); |
298 } | 300 } |
299 String path = '${generatedTestDir.path}/${split.last}'; | 301 String path = '${generatedTestDir.path}/${split.last}'; |
300 Directory dir = new Directory(path); | 302 Directory dir = new Directory(path); |
301 if (!dir.existsSync()) { | 303 if (!dir.existsSync()) { |
302 dir.createSync(); | 304 dir.createSync(); |
303 } | 305 } |
304 return new Path(new File(path).absolute.path); | 306 return new Path(new File(path).absolute.path); |
305 } | 307 } |
OLD | NEW |