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 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 = filename == 'es6_modules' | 154 var moduleFormat = filename == 'es6_modules' |
155 ? ModuleFormat.es6 | 155 ? ModuleFormat.es6 |
156 : ModuleFormat.legacy; | 156 : filename == 'node_modules' |
| 157 ? ModuleFormat.node |
| 158 : ModuleFormat.legacy; |
157 var success; | 159 var success; |
158 // TODO(vsm): Is it okay to reuse the same context here? If there is | 160 // TODO(vsm): Is it okay to reuse the same context here? If there is |
159 // overlap between test files, we may need separate ones for each | 161 // overlap between test files, we may need separate ones for each |
160 // compiler. | 162 // compiler. |
161 var compiler = | 163 var compiler = |
162 (sourceMaps || closure || moduleFormat != ModuleFormat.legacy) | 164 (sourceMaps || closure || moduleFormat != ModuleFormat.legacy) |
163 ? createCompiler(realSdkContext, | 165 ? createCompiler(realSdkContext, |
164 sourceMaps: sourceMaps, | 166 sourceMaps: sourceMaps, |
165 closure: closure, | 167 closure: closure, |
166 moduleFormat: moduleFormat) | 168 moduleFormat: moduleFormat) |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 print('[AnalysisEngine] error $message $exception'); | 253 print('[AnalysisEngine] error $message $exception'); |
252 } | 254 } |
253 | 255 |
254 @override void logError2(String message, Object exception) { | 256 @override void logError2(String message, Object exception) { |
255 print('[AnalysisEngine] error $message $exception'); | 257 print('[AnalysisEngine] error $message $exception'); |
256 } | 258 } |
257 | 259 |
258 void logInformation(String message, [CaughtException exception]) {} | 260 void logInformation(String message, [CaughtException exception]) {} |
259 void logInformation2(String message, Object exception) {} | 261 void logInformation2(String message, Object exception) {} |
260 } | 262 } |
OLD | NEW |