| 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 // Multitests are Dart test scripts containing lines of the form | 7 // Multitests are Dart test scripts containing lines of the form |
| 8 // " [some dart code] /// [key]: [error type]" | 8 // " [some dart code] /// [key]: [error type]" |
| 9 // | 9 // |
| 10 // For each key in the file, a new test file is made containing all | 10 // For each key in the file, a new test file is made containing all |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 supportsFatalTypeErrors, | 190 supportsFatalTypeErrors, |
| 191 currentKey, | 191 currentKey, |
| 192 basePath, | 192 basePath, |
| 193 doTest, | 193 doTest, |
| 194 done); | 194 done); |
| 195 }; | 195 }; |
| 196 file.create(); | 196 file.create(); |
| 197 } | 197 } |
| 198 | 198 |
| 199 String CreateMultitestDirectory(String buildDir, String testDir) { | 199 String CreateMultitestDirectory(String buildDir, String testDir) { |
| 200 final String generatedTestDirectory = 'generated_tests/'; | 200 final String generatedTestDirectory = 'generated_tests'; |
| 201 Directory parentDir = new Directory(buildDir + generatedTestDirectory); | 201 Directory parentDir = new Directory(buildDir + generatedTestDirectory); |
| 202 if (!parentDir.existsSync()) { | 202 if (!parentDir.existsSync()) { |
| 203 parentDir.createSync(); | 203 parentDir.createSync(); |
| 204 } | 204 } |
| 205 var split = testDir.split(new Platform().pathSeparator()); | 205 var split = testDir.split('/'); |
| 206 var lastComponent = split.removeLast(); | 206 var lastComponent = split.removeLast(); |
| 207 Expect.isTrue(lastComponent == 'src'); | 207 Expect.isTrue(lastComponent == 'src'); |
| 208 String path = parentDir.path + split.last(); | 208 String path = '${parentDir.path}/${split.last()}'; |
| 209 Directory dir = new Directory(path); | 209 Directory dir = new Directory(path); |
| 210 if (!dir.existsSync()) { | 210 if (!dir.existsSync()) { |
| 211 dir.createSync(); | 211 dir.createSync(); |
| 212 } | 212 } |
| 213 return path; | 213 return path; |
| 214 } | 214 } |
| OLD | NEW |