Index: pkg/dev_compiler/tool/run.js |
diff --git a/pkg/dev_compiler/tool/run.js b/pkg/dev_compiler/tool/run.js |
index a9c8c3e26c85ddd670e3fb5b9461c437943eabeb..71c4b896e924013dcbb3b2326cba187f4972c3ac 100644 |
--- a/pkg/dev_compiler/tool/run.js |
+++ b/pkg/dev_compiler/tool/run.js |
@@ -44,7 +44,15 @@ requirejs.config({ |
var sdk = requirejs('dart_sdk'); |
sdk.dart.ignoreWhitelistedErrors(false); |
+let negative = /negative_test/.test(test); |
function finish(e) { |
+ if (negative) { |
+ if (e) { |
+ e = null; |
+ } else { |
+ e = new Error("test marked as 'negative' but did not throw"); |
+ } |
+ } |
if (e) { |
console.log('Test ' + test + ' failed:\n' + e.toString()); |
sdk.dart.stackPrint(e); |
@@ -66,6 +74,7 @@ async_helper.asyncTestInitialize(finish); |
var module = requirejs(test); |
var lib = test.split('/').slice(-1)[0]; |
try { |
+ if (module[lib]._expectRuntimeError) negative = true; |
var result = module[lib].main(); |
// async_helper tests call finish directly - call here for all other |
// tests. |