OLD | NEW |
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("multitest"); | 5 #library("multitest"); |
6 | 6 |
| 7 #import("dart:io"); |
| 8 |
7 // Multitests are Dart test scripts containing lines of the form | 9 // Multitests are Dart test scripts containing lines of the form |
8 // " [some dart code] /// [key]: [error type]" | 10 // " [some dart code] /// [key]: [error type]" |
9 // | 11 // |
10 // For each key in the file, a new test file is made containing all | 12 // For each key in the file, a new test file is made containing all |
11 // the normal lines of the file, and all of the multitest lines containing | 13 // the normal lines of the file, and all of the multitest lines containing |
12 // that key, in the same order as in the source file. The new test | 14 // that key, in the same order as in the source file. The new test |
13 // is expected to fail if there is a non-empty error type listed, of | 15 // is expected to fail if there is a non-empty error type listed, of |
14 // type 'compile-time error', 'runtime error', 'static type error', or | 16 // type 'compile-time error', 'runtime error', 'static type error', or |
15 // 'dynamic type error'. The type error tests fail only in checked mode. | 17 // 'dynamic type error'. The type error tests fail only in checked mode. |
16 // There is also a test created from only the untagged lines of the file, | 18 // There is also a test created from only the untagged lines of the file, |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 var split = testDir.split('/'); | 169 var split = testDir.split('/'); |
168 var lastComponent = split.removeLast(); | 170 var lastComponent = split.removeLast(); |
169 Expect.isTrue(lastComponent == 'src'); | 171 Expect.isTrue(lastComponent == 'src'); |
170 String path = '${generatedTestDir.path}/${split.last()}'; | 172 String path = '${generatedTestDir.path}/${split.last()}'; |
171 Directory dir = new Directory(path); | 173 Directory dir = new Directory(path); |
172 if (!dir.existsSync()) { | 174 if (!dir.existsSync()) { |
173 dir.createSync(); | 175 dir.createSync(); |
174 } | 176 } |
175 return path; | 177 return path; |
176 } | 178 } |
OLD | NEW |