| 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 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 }; | 181 }; |
| 182 file.create(); | 182 file.create(); |
| 183 } | 183 } |
| 184 | 184 |
| 185 String CreateMultitestDirectory(String buildDir, String testDir) { | 185 String CreateMultitestDirectory(String buildDir, String testDir) { |
| 186 final String generatedTestDirectory = 'generated_tests/'; | 186 final String generatedTestDirectory = 'generated_tests/'; |
| 187 Directory parent_dir = new Directory(buildDir + generatedTestDirectory); | 187 Directory parent_dir = new Directory(buildDir + generatedTestDirectory); |
| 188 if (!parent_dir.existsSync()) { | 188 if (!parent_dir.existsSync()) { |
| 189 parent_dir.createSync(); | 189 parent_dir.createSync(); |
| 190 } | 190 } |
| 191 final String prefix = 'tests/'; | 191 var split = testDir.split(new Platform().pathSeparator()); |
| 192 final String suffix = '/src'; | 192 var lastComponent = split.removeLast(); |
| 193 Expect.isTrue(testDir.startsWith(prefix)); | 193 Expect.isTrue(lastComponent == 'src'); |
| 194 Expect.isTrue(testDir.endsWith(suffix)); | 194 String path = parent_dir.path + split.last(); |
| 195 String path = parent_dir.path + | |
| 196 testDir.substring(prefix.length, testDir.length - suffix.length); | |
| 197 Directory dir = new Directory(path); | 195 Directory dir = new Directory(path); |
| 198 if (!dir.existsSync()) { | 196 if (!dir.existsSync()) { |
| 199 dir.createSync(); | 197 dir.createSync(); |
| 200 } | 198 } |
| 201 return path; | 199 return path; |
| 202 } | 200 } |
| OLD | NEW |