| 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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 reportWarning(NO_LOCATION_SPANNABLE, | 92 reportWarning(NO_LOCATION_SPANNABLE, |
| 93 MessageKind.GENERIC, {'text': marker}); | 93 MessageKind.GENERIC, {'text': marker}); |
| 94 break; | 94 break; |
| 95 case 'error': | 95 case 'error': |
| 96 onTest(testMarker, testType); | 96 onTest(testMarker, testType); |
| 97 reportError(NO_LOCATION_SPANNABLE, | 97 reportError(NO_LOCATION_SPANNABLE, |
| 98 MessageKind.GENERIC, {'text': marker}); | 98 MessageKind.GENERIC, {'text': marker}); |
| 99 break; | 99 break; |
| 100 case 'fatalError': | 100 case 'fatalError': |
| 101 onTest(testMarker, testType); | 101 onTest(testMarker, testType); |
| 102 reportFatalError(NO_LOCATION_SPANNABLE, | 102 reportError(NO_LOCATION_SPANNABLE, |
| 103 MessageKind.GENERIC, {'text': marker}); | 103 MessageKind.GENERIC, {'text': marker}); |
| 104 throw new CompilerCancelledException(null); |
| 104 break; | 105 break; |
| 105 case 'internalError': | 106 case 'internalError': |
| 106 onTest(testMarker, testType); | 107 onTest(testMarker, testType); |
| 107 internalError(NO_LOCATION_SPANNABLE, marker); | 108 internalError(NO_LOCATION_SPANNABLE, marker); |
| 108 break; | 109 break; |
| 109 case 'NoSuchMethodError': | 110 case 'NoSuchMethodError': |
| 110 onTest(testMarker, testType); | 111 onTest(testMarker, testType); |
| 111 null.foo; | 112 null.foo; |
| 112 break; | 113 break; |
| 113 case '': | 114 case '': |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 int countResults(Map runType) { | 258 int countResults(Map runType) { |
| 258 return runType.length * | 259 return runType.length * |
| 259 tests.values.where((r) => r == runType).length; | 260 tests.values.where((r) => r == runType).length; |
| 260 } | 261 } |
| 261 | 262 |
| 262 Expect.equals(countResults(beforeRun) + countResults(duringRun), | 263 Expect.equals(countResults(beforeRun) + countResults(duringRun), |
| 263 checkedResults); | 264 checkedResults); |
| 264 asyncEnd(); | 265 asyncEnd(); |
| 265 }); | 266 }); |
| 266 } | 267 } |
| OLD | NEW |