Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(956)

Unified Diff: tests/compiler/dart2js/exit_code_test.dart

Issue 206193002: Remove cancel and make crash exit with code 253. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comments. Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/world.dart ('k') | tests/compiler/dart2js/mock_compiler.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/compiler/dart2js/exit_code_test.dart
diff --git a/tests/compiler/dart2js/exit_code_test.dart b/tests/compiler/dart2js/exit_code_test.dart
index 4db2ecd5e8a479d42c7550d9e7830c2eeccaf7a3..f1192f01c67593e922bef3217073c34a78089ded 100644
--- a/tests/compiler/dart2js/exit_code_test.dart
+++ b/tests/compiler/dart2js/exit_code_test.dart
@@ -84,23 +84,27 @@ class TestCompiler extends apiimpl.Compiler {
break;
case 'invariant':
onTest(testMarker, testType);
- invariant(CURRENT_ELEMENT_SPANNABLE, false, message: marker);
+ invariant(NO_LOCATION_SPANNABLE, false, message: marker);
break;
case 'warning':
onTest(testMarker, testType);
- reportWarning(CURRENT_ELEMENT_SPANNABLE,
+ reportWarning(NO_LOCATION_SPANNABLE,
MessageKind.GENERIC, {'text': marker});
break;
case 'error':
onTest(testMarker, testType);
- reportError(CURRENT_ELEMENT_SPANNABLE,
+ reportError(NO_LOCATION_SPANNABLE,
MessageKind.GENERIC, {'text': marker});
break;
case 'fatalError':
onTest(testMarker, testType);
- reportFatalError(CURRENT_ELEMENT_SPANNABLE,
+ reportFatalError(NO_LOCATION_SPANNABLE,
MessageKind.GENERIC, {'text': marker});
break;
+ case 'internalError':
+ onTest(testMarker, testType);
+ internalError(NO_LOCATION_SPANNABLE, marker);
+ break;
case 'NoSuchMethodError':
onTest(testMarker, testType);
null.foo;
@@ -156,7 +160,8 @@ Future testExitCode(String marker, String type, int expectedExitCode) {
Map<String, dynamic> environment = const {}]) {
libraryRoot = Platform.script.resolve('../../../sdk/');
outputProvider = NullSink.outputProvider;
- handler = (uri, begin, end, message, kind) {};
+ // Use this to silence the test when debugging:
+ // handler = (uri, begin, end, message, kind) {};
Compiler compiler = new TestCompiler(inputProvider,
outputProvider,
handler,
@@ -218,29 +223,28 @@ Future testExitCodes(String marker, Map<String,int> expectedExitCodes) {
}
void main() {
- // TODO(johnniwinther): implement this test for unchecked mode.
bool isCheckedMode = false;
- assert(isCheckedMode = true);
- Expect.isTrue(isCheckedMode, 'This test must be run in checked mode.');
+ assert((isCheckedMode = true));
- const beforeRun = const {
+ final beforeRun = {
'': 0,
'NoSuchMethodError': 253,
- 'assert': 253,
+ 'assert': isCheckedMode ? 253 : 0,
'invariant': 253
};
- const duringRun = const {
+ final duringRun = {
'': 0,
'NoSuchMethodError': 253,
- 'assert': 253,
+ 'assert': isCheckedMode ? 253 : 0,
'invariant': 253,
'warning': 0,
'error': 1,
'fatalError': 1,
+ 'internalError': 253,
};
- const tests = const {
+ final tests = {
'Compiler': beforeRun,
'Compiler.run': beforeRun,
'Compiler.scanBuiltinLibraries': beforeRun,
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/world.dart ('k') | tests/compiler/dart2js/mock_compiler.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698