OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 // Test the exit code of dart2js in case of exceptions, errors, warnings, etc. | 5 // Test the exit code of dart2js in case of exceptions, errors, warnings, etc. |
6 | 6 |
7 | 7 |
8 import 'dart:async'; | 8 import 'dart:async'; |
9 import 'dart:io' show Platform; | 9 import 'dart:io' show Platform; |
10 | 10 |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 : compiler = compiler, | 143 : compiler = compiler, |
144 super(compiler.dietParser, compiler.reporter, compiler.measurer); | 144 super(compiler.dietParser, compiler.reporter, compiler.measurer); |
145 | 145 |
146 void scanElements(CompilationUnitElement compilationUnit) { | 146 void scanElements(CompilationUnitElement compilationUnit) { |
147 compiler.test('ScannerTask.scanElements'); | 147 compiler.test('ScannerTask.scanElements'); |
148 super.scanElements(compilationUnit); | 148 super.scanElements(compilationUnit); |
149 } | 149 } |
150 } | 150 } |
151 | 151 |
152 class TestResolver extends ResolverTask { | 152 class TestResolver extends ResolverTask { |
| 153 final TestCompiler compiler; |
| 154 |
153 TestResolver(TestCompiler compiler, ConstantCompiler constantCompiler) | 155 TestResolver(TestCompiler compiler, ConstantCompiler constantCompiler) |
154 : super(compiler, constantCompiler); | 156 : this.compiler = compiler, |
155 | 157 super( |
156 TestCompiler get compiler => super.compiler; | 158 compiler.resolution, |
| 159 constantCompiler, |
| 160 compiler.world, |
| 161 compiler.measurer); |
157 | 162 |
158 void computeClassMembers(ClassElement element) { | 163 void computeClassMembers(ClassElement element) { |
159 compiler.test('ResolverTask.computeClassMembers'); | 164 compiler.test('ResolverTask.computeClassMembers'); |
160 super.computeClassMembers(element); | 165 super.computeClassMembers(element); |
161 } | 166 } |
162 } | 167 } |
163 | 168 |
164 int checkedResults = 0; | 169 int checkedResults = 0; |
165 | 170 |
166 Future testExitCode( | 171 Future testExitCode( |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 | 287 |
283 expected = _expectedExitCode( | 288 expected = _expectedExitCode( |
284 beforeRun: tests[marker], fatalWarnings: true); | 289 beforeRun: tests[marker], fatalWarnings: true); |
285 totalExpectedErrors += expected.length; | 290 totalExpectedErrors += expected.length; |
286 await testExitCodes(marker, expected, ['--fatal-warnings']); | 291 await testExitCodes(marker, expected, ['--fatal-warnings']); |
287 } | 292 } |
288 | 293 |
289 Expect.equals(totalExpectedErrors, checkedResults); | 294 Expect.equals(totalExpectedErrors, checkedResults); |
290 }); | 295 }); |
291 } | 296 } |
OLD | NEW |