| 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 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 enableFatalTypeErrors); | 152 enableFatalTypeErrors); |
| 153 } | 153 } |
| 154 multitestDone(); | 154 multitestDone(); |
| 155 } | 155 } |
| 156 | 156 |
| 157 | 157 |
| 158 String CreateMultitestDirectory(String outputDir, String testDir) { | 158 String CreateMultitestDirectory(String outputDir, String testDir) { |
| 159 final String generatedTestDirectory = 'generated_tests'; | 159 final String generatedTestDirectory = 'generated_tests'; |
| 160 Directory parentDir = new Directory(outputDir + generatedTestDirectory); | 160 Directory parentDir = new Directory(outputDir + generatedTestDirectory); |
| 161 if (!new Directory(outputDir).existsSync()) { | 161 if (!new Directory(outputDir).existsSync()) { |
| 162 print('test.dart: build dir does not exist: $outputDir'); |
| 162 new Directory(outputDir).createSync(); | 163 new Directory(outputDir).createSync(); |
| 163 } | 164 } |
| 164 if (!parentDir.existsSync()) { | 165 if (!parentDir.existsSync()) { |
| 166 print('test.dart: generated tests dir does not exist: ${parentDir.path}'); |
| 165 parentDir.createSync(); | 167 parentDir.createSync(); |
| 166 } | 168 } |
| 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 = '${parentDir.path}/${split.last()}'; | 172 String path = '${parentDir.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 |