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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 case 'assert': | 91 case 'assert': |
92 onTest(testMarker, testType); | 92 onTest(testMarker, testType); |
93 assert(false); | 93 assert(false); |
94 break; | 94 break; |
95 case 'invariant': | 95 case 'invariant': |
96 onTest(testMarker, testType); | 96 onTest(testMarker, testType); |
97 invariant(NO_LOCATION_SPANNABLE, false, message: marker); | 97 invariant(NO_LOCATION_SPANNABLE, false, message: marker); |
98 break; | 98 break; |
99 case 'warning': | 99 case 'warning': |
100 onTest(testMarker, testType); | 100 onTest(testMarker, testType); |
101 reportWarning(NO_LOCATION_SPANNABLE, | 101 reportWarning(createMessage( |
102 MessageKind.GENERIC, {'text': marker}); | 102 NO_LOCATION_SPANNABLE, |
| 103 MessageKind.GENERIC, {'text': marker})); |
103 break; | 104 break; |
104 case 'error': | 105 case 'error': |
105 onTest(testMarker, testType); | 106 onTest(testMarker, testType); |
106 reportError(NO_LOCATION_SPANNABLE, | 107 reportError(createMessage( |
107 MessageKind.GENERIC, {'text': marker}); | 108 NO_LOCATION_SPANNABLE, |
| 109 MessageKind.GENERIC, {'text': marker})); |
108 break; | 110 break; |
109 case 'internalError': | 111 case 'internalError': |
110 onTest(testMarker, testType); | 112 onTest(testMarker, testType); |
111 internalError(NO_LOCATION_SPANNABLE, marker); | 113 internalError(NO_LOCATION_SPANNABLE, marker); |
112 break; | 114 break; |
113 case 'NoSuchMethodError': | 115 case 'NoSuchMethodError': |
114 onTest(testMarker, testType); | 116 onTest(testMarker, testType); |
115 null.foo; | 117 null.foo; |
116 break; | 118 break; |
117 case '': | 119 case '': |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
277 | 279 |
278 expected = _expectedExitCode( | 280 expected = _expectedExitCode( |
279 beforeRun: tests[marker], fatalWarnings: true); | 281 beforeRun: tests[marker], fatalWarnings: true); |
280 totalExpectedErrors += expected.length; | 282 totalExpectedErrors += expected.length; |
281 await testExitCodes(marker, expected, ['--fatal-warnings']); | 283 await testExitCodes(marker, expected, ['--fatal-warnings']); |
282 } | 284 } |
283 | 285 |
284 Expect.equals(totalExpectedErrors, checkedResults); | 286 Expect.equals(totalExpectedErrors, checkedResults); |
285 }); | 287 }); |
286 } | 288 } |
OLD | NEW |