| 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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 setUp(() { | 122 setUp(() { |
| 123 savedLogger = AnalysisEngine.instance.logger; | 123 savedLogger = AnalysisEngine.instance.logger; |
| 124 AnalysisEngine.instance.logger = new PrintLogger(); | 124 AnalysisEngine.instance.logger = new PrintLogger(); |
| 125 }); | 125 }); |
| 126 tearDown(() { | 126 tearDown(() { |
| 127 AnalysisEngine.instance.logger = savedLogger; | 127 AnalysisEngine.instance.logger = savedLogger; |
| 128 }); | 128 }); |
| 129 | 129 |
| 130 test('devc dart:core', () { | 130 test('devc dart:core', () { |
| 131 var testSdkContext = createAnalysisContextWithSources( | 131 var testSdkContext = createAnalysisContextWithSources( |
| 132 new StrongModeOptions(), new SourceResolverOptions( | 132 new StrongModeOptions(), |
| 133 dartSdkPath: path.join( | 133 new SourceResolverOptions( |
| 134 testDirectory, '..', 'tool', 'generated_sdk'))); | 134 dartSdkPath: |
| 135 path.join(testDirectory, '..', 'tool', 'generated_sdk'))); |
| 135 | 136 |
| 136 // Get the test SDK. We use a checked in copy so test expectations can | 137 // Get the test SDK. We use a checked in copy so test expectations can |
| 137 // be generated against a specific SDK version. | 138 // be generated against a specific SDK version. |
| 138 compile('dart:core', testSdkContext, checkSdk: true); | 139 compile('dart:core', testSdkContext, checkSdk: true); |
| 139 var outFile = new File(path.join(expectDir, 'dart/core.js')); | 140 var outFile = new File(path.join(expectDir, 'dart/core.js')); |
| 140 expect(outFile.existsSync(), true, | 141 expect(outFile.existsSync(), true, |
| 141 reason: '${outFile.path} was created for dart:core'); | 142 reason: '${outFile.path} was created for dart:core'); |
| 142 }); | 143 }); |
| 143 }); | 144 }); |
| 144 } | 145 } |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 print('[AnalysisEngine] error $message $exception'); | 199 print('[AnalysisEngine] error $message $exception'); |
| 199 } | 200 } |
| 200 | 201 |
| 201 @override void logError2(String message, Object exception) { | 202 @override void logError2(String message, Object exception) { |
| 202 print('[AnalysisEngine] error $message $exception'); | 203 print('[AnalysisEngine] error $message $exception'); |
| 203 } | 204 } |
| 204 | 205 |
| 205 void logInformation(String message, [CaughtException exception]) {} | 206 void logInformation(String message, [CaughtException exception]) {} |
| 206 void logInformation2(String message, Object exception) {} | 207 void logInformation2(String message, Object exception) {} |
| 207 } | 208 } |
| OLD | NEW |