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

Unified Diff: pkg/dev_compiler/tool/run.js

Issue 2930203002: fix test runner to understand mutlitests that expect an error (Closed)
Patch Set: Created 3 years, 6 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 | « pkg/dev_compiler/test/multitest.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
« no previous file with comments | « pkg/dev_compiler/test/multitest.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698