| 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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 String this.testType, | 51 String this.testType, |
| 52 Function this.onTest) | 52 Function this.onTest) |
| 53 : super(inputProvider, outputProvider, handler, | 53 : super(inputProvider, outputProvider, handler, |
| 54 new api.CompilerOptions.parse( | 54 new api.CompilerOptions.parse( |
| 55 libraryRoot: libraryRoot, | 55 libraryRoot: libraryRoot, |
| 56 packageRoot: packageRoot, | 56 packageRoot: packageRoot, |
| 57 options: options, | 57 options: options, |
| 58 environment: environment, | 58 environment: environment, |
| 59 packageConfig: packageConfig, | 59 packageConfig: packageConfig, |
| 60 packagesDiscoveryProvider: findPackages)) { | 60 packagesDiscoveryProvider: findPackages)) { |
| 61 scanner = new TestScanner(this); | |
| 62 resolver = new TestResolver(this, backend.constantCompilerTask); | |
| 63 reporter = new TestDiagnosticReporter(this, super.reporter); | 61 reporter = new TestDiagnosticReporter(this, super.reporter); |
| 64 test('Compiler'); | 62 test('Compiler'); |
| 65 } | 63 } |
| 66 | 64 |
| 65 @override |
| 66 ScannerTask createScannerTask() => new TestScanner(this); |
| 67 |
| 68 @override |
| 69 ResolverTask createResolverTask() { |
| 70 return new TestResolver(this, backend.constantCompilerTask); |
| 71 } |
| 72 |
| 67 Future<bool> run(Uri uri) { | 73 Future<bool> run(Uri uri) { |
| 68 test('Compiler.run'); | 74 test('Compiler.run'); |
| 69 return super.run(uri); | 75 return super.run(uri); |
| 70 } | 76 } |
| 71 | 77 |
| 72 Future onLibraryScanned(LibraryElement element, LibraryLoader loader) { | 78 Future onLibraryScanned(LibraryElement element, LibraryLoader loader) { |
| 73 test('Compiler.onLibraryScanned'); | 79 test('Compiler.onLibraryScanned'); |
| 74 return super.onLibraryScanned(element, loader); | 80 return super.onLibraryScanned(element, loader); |
| 75 } | 81 } |
| 76 | 82 |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 | 304 |
| 299 expected = _expectedExitCode( | 305 expected = _expectedExitCode( |
| 300 beforeRun: tests[marker], fatalWarnings: true); | 306 beforeRun: tests[marker], fatalWarnings: true); |
| 301 totalExpectedErrors += expected.length; | 307 totalExpectedErrors += expected.length; |
| 302 await testExitCodes(marker, expected, ['--fatal-warnings']); | 308 await testExitCodes(marker, expected, ['--fatal-warnings']); |
| 303 } | 309 } |
| 304 | 310 |
| 305 Expect.equals(totalExpectedErrors, checkedResults); | 311 Expect.equals(totalExpectedErrors, checkedResults); |
| 306 }); | 312 }); |
| 307 } | 313 } |
| OLD | NEW |