| 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 ddc.test.codegen_test; | 8 library ddc.test.codegen_test; |
| 9 | 9 |
| 10 import 'dart:io'; | 10 import 'dart:io'; |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 test('devc dart:core', () { | 111 test('devc dart:core', () { |
| 112 // Get the test SDK. We use a checked in copy so test expectations can be | 112 // Get the test SDK. We use a checked in copy so test expectations can be |
| 113 // generated against a specific SDK version. | 113 // generated against a specific SDK version. |
| 114 // TODO(jmesserly): eventually we should track compiler messages. | 114 // TODO(jmesserly): eventually we should track compiler messages. |
| 115 // For now we're just trying to get decent code generation. | 115 // For now we're just trying to get decent code generation. |
| 116 var options = new CompilerOptions( | 116 var options = new CompilerOptions( |
| 117 outputDir: actualDir, | 117 outputDir: actualDir, |
| 118 checkSdk: true, | 118 checkSdk: true, |
| 119 forceCompile: true, | 119 forceCompile: true, |
| 120 outputDart: dartGen, | 120 outputDart: dartGen, |
| 121 formatOutput: false); | 121 formatOutput: dartGen, |
| 122 cheapTestFormat: true); |
| 122 var sdkPath = dartGen | 123 var sdkPath = dartGen |
| 123 ? path.join(testDir, '..', 'tool', 'input_sdk_src') | 124 ? path.join(testDir, '..', 'tool', 'input_sdk_src') |
| 124 : path.join(testDir, 'generated_sdk'); | 125 : path.join(testDir, 'generated_sdk'); |
| 125 var testSdk = new TypeResolver.fromDir(sdkPath, options); | 126 var testSdk = new TypeResolver.fromDir(sdkPath, options); |
| 126 var result = compile('dart:core', testSdk, options); | 127 var result = compile('dart:core', testSdk, options); |
| 127 var outputDir = new Directory(path.join(actualDir, 'core')); | 128 var outputDir = new Directory(path.join(actualDir, 'core')); |
| 128 expect(outputDir.existsSync(), true, | 129 expect(outputDir.existsSync(), true, |
| 129 reason: '${outputDir.path} was created for dart:core'); | 130 reason: '${outputDir.path} was created for dart:core'); |
| 130 }); | 131 }); |
| 131 }); | 132 }); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 155 print('[AnalysisEngine] error $message $exception'); | 156 print('[AnalysisEngine] error $message $exception'); |
| 156 } | 157 } |
| 157 | 158 |
| 158 @override void logError2(String message, Object exception) { | 159 @override void logError2(String message, Object exception) { |
| 159 print('[AnalysisEngine] error $message $exception'); | 160 print('[AnalysisEngine] error $message $exception'); |
| 160 } | 161 } |
| 161 | 162 |
| 162 void logInformation(String message, [CaughtException exception]) {} | 163 void logInformation(String message, [CaughtException exception]) {} |
| 163 void logInformation2(String message, Object exception) {} | 164 void logInformation2(String message, Object exception) {} |
| 164 } | 165 } |
| OLD | NEW |