| 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 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 isNegative, | 150 isNegative, |
| 151 isNegativeIfChecked, | 151 isNegativeIfChecked, |
| 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 generatedTestDir = new Directory('$outputDir/generated_tests'); |
| 161 if (!new Directory(outputDir).existsSync()) { | 161 if (!new Directory(outputDir).existsSync()) { |
| 162 print('test.dart: build dir does not exist: $outputDir'); | |
| 163 new Directory(outputDir).createSync(); | 162 new Directory(outputDir).createSync(); |
| 164 } | 163 } |
| 165 if (!parentDir.existsSync()) { | 164 if (!generatedTestDir.existsSync()) { |
| 166 print('test.dart: generated tests dir does not exist: ${parentDir.path}'); | 165 generatedTestDir.createSync(); |
| 167 parentDir.createSync(); | |
| 168 } | 166 } |
| 169 var split = testDir.split('/'); | 167 var split = testDir.split('/'); |
| 170 var lastComponent = split.removeLast(); | 168 var lastComponent = split.removeLast(); |
| 171 Expect.isTrue(lastComponent == 'src'); | 169 Expect.isTrue(lastComponent == 'src'); |
| 172 String path = '${parentDir.path}/${split.last()}'; | 170 String path = '${generatedTestDir.path}/${split.last()}'; |
| 173 Directory dir = new Directory(path); | 171 Directory dir = new Directory(path); |
| 174 if (!dir.existsSync()) { | 172 if (!dir.existsSync()) { |
| 175 dir.createSync(); | 173 dir.createSync(); |
| 176 } | 174 } |
| 177 return path; | 175 return path; |
| 178 } | 176 } |
| OLD | NEW |