| 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 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 }); | 188 }); |
| 189 } | 189 } |
| 190 | 190 |
| 191 Future testExitCodes(String marker, Map<String,int> expectedExitCodes) { | 191 Future testExitCodes(String marker, Map<String,int> expectedExitCodes) { |
| 192 return Future.forEach(expectedExitCodes.keys, (String type) { | 192 return Future.forEach(expectedExitCodes.keys, (String type) { |
| 193 return testExitCode(marker, type, expectedExitCodes[type]); | 193 return testExitCode(marker, type, expectedExitCodes[type]); |
| 194 }); | 194 }); |
| 195 } | 195 } |
| 196 | 196 |
| 197 void main() { | 197 void main() { |
| 198 bool isCheckedMode = false; |
| 199 assert(isCheckedMode = true); |
| 200 Expect.isTrue(isCheckedMode, 'This test must be run in checked mode.'); |
| 201 |
| 198 const beforeRun = const { | 202 const beforeRun = const { |
| 199 '': 0, | 203 '': 0, |
| 200 'NoSuchMethodError': 253, | 204 'NoSuchMethodError': 253, |
| 201 'assert': 253, | 205 'assert': 253, |
| 202 'invariant': 253 | 206 'invariant': 253 |
| 203 }; | 207 }; |
| 204 | 208 |
| 205 const duringRun = const { | 209 const duringRun = const { |
| 206 '': 0, | 210 '': 0, |
| 207 'NoSuchMethodError': 253, | 211 'NoSuchMethodError': 253, |
| (...skipping 15 matching lines...) Expand all Loading... |
| 223 | 227 |
| 224 asyncStart(); | 228 asyncStart(); |
| 225 Future.forEach(tests.keys, (marker) { | 229 Future.forEach(tests.keys, (marker) { |
| 226 return testExitCodes(marker, tests[marker]); | 230 return testExitCodes(marker, tests[marker]); |
| 227 }).then((_) { | 231 }).then((_) { |
| 228 Expect.equals(beforeRun.length * 2 + duringRun.length * 4, | 232 Expect.equals(beforeRun.length * 2 + duringRun.length * 4, |
| 229 checkedResults); | 233 checkedResults); |
| 230 asyncEnd(); | 234 asyncEnd(); |
| 231 }); | 235 }); |
| 232 } | 236 } |
| OLD | NEW |