| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 /// Tests code generation. | 5 /// Tests code generation. |
| 6 /// Runs Dart Dev Compiler on all input in the `codegen` directory and checks | 6 /// Runs Dart Dev Compiler on all input in the `codegen` directory and checks |
| 7 /// that the output is what we expected. | 7 /// that the output is what we expected. |
| 8 library dev_compiler.test.codegen_test; | 8 library dev_compiler.test.codegen_test; |
| 9 | 9 |
| 10 import 'dart:io'; | 10 import 'dart:io'; |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 if (multitests.contains(filePath)) continue; | 144 if (multitests.contains(filePath)) continue; |
| 145 | 145 |
| 146 var filename = path.basenameWithoutExtension(filePath); | 146 var filename = path.basenameWithoutExtension(filePath); |
| 147 | 147 |
| 148 test('$filename.dart', () { | 148 test('$filename.dart', () { |
| 149 // TODO(jmesserly): this was added to get some coverage of source maps | 149 // TODO(jmesserly): this was added to get some coverage of source maps |
| 150 // and closure annotations. | 150 // and closure annotations. |
| 151 // We need a more comprehensive strategy to test them. | 151 // We need a more comprehensive strategy to test them. |
| 152 var sourceMaps = filename == 'map_keys'; | 152 var sourceMaps = filename == 'map_keys'; |
| 153 var closure = filename == 'closure'; | 153 var closure = filename == 'closure'; |
| 154 var moduleFormat = | 154 var moduleFormat = filename == 'es6_modules' |
| 155 filename == 'es6_modules' ? ModuleFormat.es6 : ModuleFormat.legacy
; | 155 ? ModuleFormat.es6 |
| 156 : ModuleFormat.legacy; |
| 156 var success; | 157 var success; |
| 157 // TODO(vsm): Is it okay to reuse the same context here? If there is | 158 // TODO(vsm): Is it okay to reuse the same context here? If there is |
| 158 // overlap between test files, we may need separate ones for each | 159 // overlap between test files, we may need separate ones for each |
| 159 // compiler. | 160 // compiler. |
| 160 var compiler = | 161 var compiler = |
| 161 (sourceMaps || closure || moduleFormat != ModuleFormat.legacy) | 162 (sourceMaps || closure || moduleFormat != ModuleFormat.legacy) |
| 162 ? createCompiler(realSdkContext, | 163 ? createCompiler(realSdkContext, |
| 163 sourceMaps: sourceMaps, | 164 sourceMaps: sourceMaps, |
| 164 closure: closure, | 165 closure: closure, |
| 165 moduleFormat: moduleFormat) | 166 moduleFormat: moduleFormat) |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 print('[AnalysisEngine] error $message $exception'); | 251 print('[AnalysisEngine] error $message $exception'); |
| 251 } | 252 } |
| 252 | 253 |
| 253 @override void logError2(String message, Object exception) { | 254 @override void logError2(String message, Object exception) { |
| 254 print('[AnalysisEngine] error $message $exception'); | 255 print('[AnalysisEngine] error $message $exception'); |
| 255 } | 256 } |
| 256 | 257 |
| 257 void logInformation(String message, [CaughtException exception]) {} | 258 void logInformation(String message, [CaughtException exception]) {} |
| 258 void logInformation2(String message, Object exception) {} | 259 void logInformation2(String message, Object exception) {} |
| 259 } | 260 } |
| OLD | NEW |