| 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 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 | 213 |
| 214 // Wait until all imports are copied before scheduling test cases. | 214 // Wait until all imports are copied before scheduling test cases. |
| 215 return Future.wait(futureCopies).then((_) { | 215 return Future.wait(futureCopies).then((_) { |
| 216 String baseFilename = filePath.filenameWithoutExtension; | 216 String baseFilename = filePath.filenameWithoutExtension; |
| 217 for (String key in tests.keys) { | 217 for (String key in tests.keys) { |
| 218 final Path multitestFilename = | 218 final Path multitestFilename = |
| 219 targetDir.append('${baseFilename}_$key.dart'); | 219 targetDir.append('${baseFilename}_$key.dart'); |
| 220 final File file = new File.fromPath(multitestFilename); | 220 final File file = new File.fromPath(multitestFilename); |
| 221 | 221 |
| 222 file.createSync(); | 222 file.createSync(); |
| 223 RandomAccessFile openedFile = file.openSync(mode: FileMode.WRITE); | 223 RandomAccessFile openedFile = file.openSync(FileMode.WRITE); |
| 224 openedFile.writeStringSync(tests[key]); | 224 openedFile.writeStringSync(tests[key]); |
| 225 openedFile.closeSync(); | 225 openedFile.closeSync(); |
| 226 Set<String> outcome = outcomes[key]; | 226 Set<String> outcome = outcomes[key]; |
| 227 bool enableFatalTypeErrors = outcome.contains('static type warning'); | 227 bool enableFatalTypeErrors = outcome.contains('static type warning'); |
| 228 bool hasRuntimeErrors = outcome.contains('runtime error'); | 228 bool hasRuntimeErrors = outcome.contains('runtime error'); |
| 229 bool hasCompileError = outcome.contains('compile-time error'); | 229 bool hasCompileError = outcome.contains('compile-time error'); |
| 230 bool isNegativeIfChecked = outcome.contains('dynamic type error'); | 230 bool isNegativeIfChecked = outcome.contains('dynamic type error'); |
| 231 doTest(multitestFilename, | 231 doTest(multitestFilename, |
| 232 hasCompileError, | 232 hasCompileError, |
| 233 hasRuntimeErrors, | 233 hasRuntimeErrors, |
| (...skipping 22 matching lines...) Expand all Loading... |
| 256 // TestSuite.forDirectory. | 256 // TestSuite.forDirectory. |
| 257 split.removeLast(); | 257 split.removeLast(); |
| 258 } | 258 } |
| 259 String path = '${generatedTestDir.path}/${split.last}'; | 259 String path = '${generatedTestDir.path}/${split.last}'; |
| 260 Directory dir = new Directory(path); | 260 Directory dir = new Directory(path); |
| 261 if (!dir.existsSync()) { | 261 if (!dir.existsSync()) { |
| 262 dir.createSync(); | 262 dir.createSync(); |
| 263 } | 263 } |
| 264 return new Path(new File(path).fullPathSync()); | 264 return new Path(new File(path).fullPathSync()); |
| 265 } | 265 } |
| OLD | NEW |