| 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, fatal errors, errors, | 5 // Test the exit code of dart2js in case of exceptions, fatal errors, errors, |
| 6 // warnings, etc. | 6 // warnings, etc. |
| 7 | 7 |
| 8 | 8 |
| 9 import 'dart:async'; | 9 import 'dart:async'; |
| 10 import 'dart:io' show Platform; | 10 import 'dart:io' show Platform; |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 Uri libraryRoot, | 32 Uri libraryRoot, |
| 33 Uri packageRoot, | 33 Uri packageRoot, |
| 34 List<String> options, | 34 List<String> options, |
| 35 Map<String, dynamic> environment, | 35 Map<String, dynamic> environment, |
| 36 String this.testMarker, | 36 String this.testMarker, |
| 37 String this.testType, | 37 String this.testType, |
| 38 Function this.onTest) | 38 Function this.onTest) |
| 39 : super(inputProvider, outputProvider, handler, libraryRoot, | 39 : super(inputProvider, outputProvider, handler, libraryRoot, |
| 40 packageRoot, options, environment) { | 40 packageRoot, options, environment) { |
| 41 scanner = new TestScanner(this); | 41 scanner = new TestScanner(this); |
| 42 resolver = new TestResolver(this); | 42 resolver = new TestResolver(this, backend.constantCompilerTask); |
| 43 test('Compiler'); | 43 test('Compiler'); |
| 44 } | 44 } |
| 45 | 45 |
| 46 Future<bool> run(Uri uri) { | 46 Future<bool> run(Uri uri) { |
| 47 test('Compiler.run'); | 47 test('Compiler.run'); |
| 48 return super.run(uri); | 48 return super.run(uri); |
| 49 } | 49 } |
| 50 | 50 |
| 51 Future scanBuiltinLibraries() { | 51 Future scanBuiltinLibraries() { |
| 52 test('Compiler.scanBuiltinLibraries'); | 52 test('Compiler.scanBuiltinLibraries'); |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 | 122 |
| 123 TestCompiler get compiler => super.compiler; | 123 TestCompiler get compiler => super.compiler; |
| 124 | 124 |
| 125 void scanElements(CompilationUnitElement compilationUnit) { | 125 void scanElements(CompilationUnitElement compilationUnit) { |
| 126 compiler.test('ScannerTask.scanElements'); | 126 compiler.test('ScannerTask.scanElements'); |
| 127 super.scanElements(compilationUnit); | 127 super.scanElements(compilationUnit); |
| 128 } | 128 } |
| 129 } | 129 } |
| 130 | 130 |
| 131 class TestResolver extends ResolverTask { | 131 class TestResolver extends ResolverTask { |
| 132 TestResolver(TestCompiler compiler) : super(compiler); | 132 TestResolver(TestCompiler compiler, ConstantCompiler constantCompiler) |
| 133 : super(compiler, constantCompiler); |
| 133 | 134 |
| 134 TestCompiler get compiler => super.compiler; | 135 TestCompiler get compiler => super.compiler; |
| 135 | 136 |
| 136 void computeClassMembers(ClassElement element) { | 137 void computeClassMembers(ClassElement element) { |
| 137 compiler.test('ResolverTask.computeClassMembers'); | 138 compiler.test('ResolverTask.computeClassMembers'); |
| 138 super.computeClassMembers(element); | 139 super.computeClassMembers(element); |
| 139 } | 140 } |
| 140 } | 141 } |
| 141 | 142 |
| 142 int checkedResults = 0; | 143 int checkedResults = 0; |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 263 int countResults(Map runType) { | 264 int countResults(Map runType) { |
| 264 return runType.length * | 265 return runType.length * |
| 265 tests.values.where((r) => r == runType).length; | 266 tests.values.where((r) => r == runType).length; |
| 266 } | 267 } |
| 267 | 268 |
| 268 Expect.equals(countResults(beforeRun) + countResults(duringRun), | 269 Expect.equals(countResults(beforeRun) + countResults(duringRun), |
| 269 checkedResults); | 270 checkedResults); |
| 270 asyncEnd(); | 271 asyncEnd(); |
| 271 }); | 272 }); |
| 272 } | 273 } |
| OLD | NEW |