diff options
-rw-r--r-- | tools/wpt/runner.ts | 14 | ||||
-rw-r--r-- | tools/wpt/testharnessreport.js | 2 |
2 files changed, 10 insertions, 6 deletions
diff --git a/tools/wpt/runner.ts b/tools/wpt/runner.ts index 3a412a56c..0cf625f01 100644 --- a/tools/wpt/runner.ts +++ b/tools/wpt/runner.ts @@ -168,9 +168,13 @@ async function generateBundle(location: URL): Promise<string> { } } - return scriptContents.map(([url, contents]) => - `Deno.core.evalContext(${JSON.stringify(contents)}, ${ - JSON.stringify(url) - });` - ).join("\n"); + return scriptContents.map(([url, contents]) => ` +(function() { + const [_,err] = Deno.core.evalContext(${JSON.stringify(contents)}, ${ + JSON.stringify(url) + }); + if (err !== null) { + throw err?.thrown; + } +})();`).join("\n"); } diff --git a/tools/wpt/testharnessreport.js b/tools/wpt/testharnessreport.js index 04251c852..24383a5b0 100644 --- a/tools/wpt/testharnessreport.js +++ b/tools/wpt/testharnessreport.js @@ -18,5 +18,5 @@ window.add_completion_callback((_tests, harnessStatus) => { while (bytesWritten < data.byteLength) { bytesWritten += Deno.stderr.writeSync(data.subarray(bytesWritten)); } - Deno.exit(0); + Deno.exit(harnessStatus.status === 0 ? 0 : 1); }); |