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 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 | 153 |
154 var filename = path.basenameWithoutExtension(filePath); | 154 var filename = path.basenameWithoutExtension(filePath); |
155 | 155 |
156 test('$filename.dart', () { | 156 test('$filename.dart', () { |
157 // TODO(jmesserly): this was added to get some coverage of source maps | 157 // TODO(jmesserly): this was added to get some coverage of source maps |
158 // and closure annotations. | 158 // and closure annotations. |
159 // We need a more comprehensive strategy to test them. | 159 // We need a more comprehensive strategy to test them. |
160 var sourceMaps = filename == 'map_keys'; | 160 var sourceMaps = filename == 'map_keys'; |
161 var closure = filename == 'closure'; | 161 var closure = filename == 'closure'; |
162 var destructureNamedParams = filename == 'destructuring' || closure; | 162 var destructureNamedParams = filename == 'destructuring' || closure; |
163 var moduleFormat = filename == 'es6_modules' | 163 var moduleFormat = filename == 'es6_modules' || closure |
164 ? ModuleFormat.es6 | 164 ? ModuleFormat.es6 |
165 : filename == 'node_modules' | 165 : filename == 'node_modules' |
166 ? ModuleFormat.node | 166 ? ModuleFormat.node |
167 : ModuleFormat.legacy; | 167 : ModuleFormat.legacy; |
168 var success; | 168 var success; |
169 // TODO(vsm): Is it okay to reuse the same context here? If there is | 169 // TODO(vsm): Is it okay to reuse the same context here? If there is |
170 // overlap between test files, we may need separate ones for each | 170 // overlap between test files, we may need separate ones for each |
171 // compiler. | 171 // compiler. |
172 var compiler = (sourceMaps || | 172 var compiler = (sourceMaps || |
173 closure || | 173 closure || |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 | 261 |
262 /// An implementation of analysis engine's [Logger] that prints. | 262 /// An implementation of analysis engine's [Logger] that prints. |
263 class PrintLogger implements Logger { | 263 class PrintLogger implements Logger { |
264 @override void logError(String message, [CaughtException exception]) { | 264 @override void logError(String message, [CaughtException exception]) { |
265 print('[AnalysisEngine] error $message $exception'); | 265 print('[AnalysisEngine] error $message $exception'); |
266 } | 266 } |
267 | 267 |
268 void logInformation(String message, [CaughtException exception]) {} | 268 void logInformation(String message, [CaughtException exception]) {} |
269 void logInformation2(String message, Object exception) {} | 269 void logInformation2(String message, Object exception) {} |
270 } | 270 } |
OLD | NEW |