OLD | NEW |
---|---|
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 import "dart:async"; | 7 import "dart:async"; |
8 import "dart:io"; | 8 import "dart:io"; |
9 import "test_suite.dart"; | 9 import "test_suite.dart"; |
10 import "utils.dart"; | 10 import "utils.dart"; |
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
258 String baseFilename = filePath.filenameWithoutExtension; | 258 String baseFilename = filePath.filenameWithoutExtension; |
259 for (String key in tests.keys) { | 259 for (String key in tests.keys) { |
260 final Path multitestFilename = | 260 final Path multitestFilename = |
261 targetDir.append('${baseFilename}_$key.dart'); | 261 targetDir.append('${baseFilename}_$key.dart'); |
262 writeFile(multitestFilename.toNativePath(), tests[key]); | 262 writeFile(multitestFilename.toNativePath(), tests[key]); |
263 Set<String> outcome = outcomes[key]; | 263 Set<String> outcome = outcomes[key]; |
264 bool hasStaticWarning = outcome.contains('static type warning'); | 264 bool hasStaticWarning = outcome.contains('static type warning'); |
265 bool hasRuntimeErrors = outcome.contains('runtime error'); | 265 bool hasRuntimeErrors = outcome.contains('runtime error'); |
266 bool hasCompileError = outcome.contains('compile-time error'); | 266 bool hasCompileError = outcome.contains('compile-time error'); |
267 bool isNegativeIfChecked = outcome.contains('dynamic type error'); | 267 bool isNegativeIfChecked = outcome.contains('dynamic type error'); |
268 bool hasCompileErrorIfChecked = outcome.contains('checked mode compile-tim e error'); | 268 bool hasCompileErrorIfChecked = outcome.contains('checked mode compile-tim e error'); |
ricow1
2014/11/05 12:22:55
not yours, but long line
| |
269 doTest(multitestFilename, | 269 doTest(multitestFilename, |
270 filePath, | |
270 hasCompileError, | 271 hasCompileError, |
271 hasRuntimeErrors, | 272 hasRuntimeErrors, |
272 isNegativeIfChecked: isNegativeIfChecked, | 273 isNegativeIfChecked: isNegativeIfChecked, |
273 hasCompileErrorIfChecked: hasCompileErrorIfChecked, | 274 hasCompileErrorIfChecked: hasCompileErrorIfChecked, |
274 hasStaticWarning: hasStaticWarning, | 275 hasStaticWarning: hasStaticWarning, |
275 multitestKey: key, | 276 multitestKey: key); |
276 originTestPath: filePath); | |
277 } | 277 } |
278 | 278 |
279 return null; | 279 return null; |
280 }); | 280 }); |
281 } | 281 } |
282 | 282 |
283 | 283 |
284 Path CreateMultitestDirectory(String outputDir, Path suiteDir) { | 284 Path CreateMultitestDirectory(String outputDir, Path suiteDir) { |
285 final String generatedTestDirectory = 'generated_tests'; | 285 final String generatedTestDirectory = 'generated_tests'; |
286 Directory generatedTestDir = new Directory('$outputDir/generated_tests'); | 286 Directory generatedTestDir = new Directory('$outputDir/generated_tests'); |
287 if (!new Directory(outputDir).existsSync()) { | 287 if (!new Directory(outputDir).existsSync()) { |
288 new Directory(outputDir).createSync(); | 288 new Directory(outputDir).createSync(); |
289 } | 289 } |
290 if (!generatedTestDir.existsSync()) { | 290 if (!generatedTestDir.existsSync()) { |
291 generatedTestDir.createSync(); | 291 generatedTestDir.createSync(); |
292 } | 292 } |
293 var split = suiteDir.segments(); | 293 var split = suiteDir.segments(); |
294 if (split.last == 'src') { | 294 if (split.last == 'src') { |
295 // TODO(sigmund): remove this once all tests are migrated to use | 295 // TODO(sigmund): remove this once all tests are migrated to use |
296 // TestSuite.forDirectory. | 296 // TestSuite.forDirectory. |
297 split.removeLast(); | 297 split.removeLast(); |
298 } | 298 } |
299 String path = '${generatedTestDir.path}/${split.last}'; | 299 String path = '${generatedTestDir.path}/${split.last}'; |
300 Directory dir = new Directory(path); | 300 Directory dir = new Directory(path); |
301 if (!dir.existsSync()) { | 301 if (!dir.existsSync()) { |
302 dir.createSync(); | 302 dir.createSync(); |
303 } | 303 } |
304 return new Path(new File(path).absolute.path); | 304 return new Path(new File(path).absolute.path); |
305 } | 305 } |
OLD | NEW |