summaryrefslogtreecommitdiff
path: root/tools/wpt/testharnessreport.js
diff options
context:
space:
mode:
authorLuca Casonato <lucacasonato@yahoo.com>2021-06-06 18:08:50 +0200
committerGitHub <noreply@github.com>2021-06-06 18:08:50 +0200
commitf1deed41e7cc04440a5fb8cdae486ae00513a361 (patch)
treee8f6e0aa24e490bee09194f31e2dac8c22867612 /tools/wpt/testharnessreport.js
parent5bd77f29e5d07af10fe9a24062c3b5b4bb79f4bf (diff)
tests: generate and upload wptreport.json (#10869)
These reports can be consumed by tools like `wptreport` or https://wpt.fyi. The old style report could be removed in a future PR when wpt.deno.land is updated.
Diffstat (limited to 'tools/wpt/testharnessreport.js')
-rw-r--r--tools/wpt/testharnessreport.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/tools/wpt/testharnessreport.js b/tools/wpt/testharnessreport.js
index d3e783376..04251c852 100644
--- a/tools/wpt/testharnessreport.js
+++ b/tools/wpt/testharnessreport.js
@@ -10,6 +10,13 @@ window.add_result_callback(({ message, name, stack, status }) => {
}
});
-window.add_completion_callback((_tests, _harnessStatus) => {
+window.add_completion_callback((_tests, harnessStatus) => {
+ const data = new TextEncoder().encode(
+ `#$#$#${JSON.stringify(harnessStatus)}\n`,
+ );
+ let bytesWritten = 0;
+ while (bytesWritten < data.byteLength) {
+ bytesWritten += Deno.stderr.writeSync(data.subarray(bytesWritten));
+ }
Deno.exit(0);
});