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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 @override | 130 @override |
131 withCurrentElement(Element element, f()) { | 131 withCurrentElement(Element element, f()) { |
132 return super.withCurrentElement(element, () { | 132 return super.withCurrentElement(element, () { |
133 compiler.test('Compiler.withCurrentElement'); | 133 compiler.test('Compiler.withCurrentElement'); |
134 return f(); | 134 return f(); |
135 }); | 135 }); |
136 } | 136 } |
137 } | 137 } |
138 | 138 |
139 class TestScanner extends ScannerTask { | 139 class TestScanner extends ScannerTask { |
| 140 final TestCompiler compiler; |
| 141 |
140 TestScanner(TestCompiler compiler) | 142 TestScanner(TestCompiler compiler) |
141 : super(compiler, compiler.dietParser); | 143 : compiler = compiler, |
142 | 144 super(compiler.dietParser, compiler.reporter, compiler.measurer); |
143 TestCompiler get compiler => super.compiler; | |
144 | 145 |
145 void scanElements(CompilationUnitElement compilationUnit) { | 146 void scanElements(CompilationUnitElement compilationUnit) { |
146 compiler.test('ScannerTask.scanElements'); | 147 compiler.test('ScannerTask.scanElements'); |
147 super.scanElements(compilationUnit); | 148 super.scanElements(compilationUnit); |
148 } | 149 } |
149 } | 150 } |
150 | 151 |
151 class TestResolver extends ResolverTask { | 152 class TestResolver extends ResolverTask { |
152 TestResolver(TestCompiler compiler, ConstantCompiler constantCompiler) | 153 TestResolver(TestCompiler compiler, ConstantCompiler constantCompiler) |
153 : super(compiler, constantCompiler); | 154 : super(compiler, constantCompiler); |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
281 | 282 |
282 expected = _expectedExitCode( | 283 expected = _expectedExitCode( |
283 beforeRun: tests[marker], fatalWarnings: true); | 284 beforeRun: tests[marker], fatalWarnings: true); |
284 totalExpectedErrors += expected.length; | 285 totalExpectedErrors += expected.length; |
285 await testExitCodes(marker, expected, ['--fatal-warnings']); | 286 await testExitCodes(marker, expected, ['--fatal-warnings']); |
286 } | 287 } |
287 | 288 |
288 Expect.equals(totalExpectedErrors, checkedResults); | 289 Expect.equals(totalExpectedErrors, checkedResults); |
289 }); | 290 }); |
290 } | 291 } |
OLD | NEW |