Chromium Code Reviews| 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 Expect.isTrue(split.removeLast() == 'src'); |
|
Bill Hesse
2011/12/01 12:59:34
Even though Expect runs all the time, not like ass
Mads Ager (google)
2011/12/01 13:02:04
Yeah, I probably should remove the last element on
| |
| 193 Expect.isTrue(testDir.startsWith(prefix)); | 193 String path = parent_dir.path + split.last(); |
| 194 Expect.isTrue(testDir.endsWith(suffix)); | |
| 195 String path = parent_dir.path + | |
| 196 testDir.substring(prefix.length, testDir.length - suffix.length); | |
| 197 Directory dir = new Directory(path); | 194 Directory dir = new Directory(path); |
| 198 if (!dir.existsSync()) { | 195 if (!dir.existsSync()) { |
| 199 dir.createSync(); | 196 dir.createSync(); |
| 200 } | 197 } |
| 201 return path; | 198 return path; |
| 202 } | 199 } |
| 200 | |
|
Bill Hesse
2011/12/01 12:59:34
Trailing blank line.
Mads Ager (google)
2011/12/01 13:02:04
Done.
| |
| OLD | NEW |