summaryrefslogtreecommitdiff
path: root/tools/wpt/runner.ts
diff options
context:
space:
mode:
Diffstat (limited to 'tools/wpt/runner.ts')
-rw-r--r--tools/wpt/runner.ts18
1 files changed, 18 insertions, 0 deletions
diff --git a/tools/wpt/runner.ts b/tools/wpt/runner.ts
index a0941b521..dcc88a123 100644
--- a/tools/wpt/runner.ts
+++ b/tools/wpt/runner.ts
@@ -47,10 +47,18 @@ export async function runWithTestUtil<T>(
export interface TestResult {
cases: TestCaseResult[];
+ harnessStatus: TestHarnessStatus | null;
+ duration: number;
status: number;
stderr: string;
}
+export interface TestHarnessStatus {
+ status: number;
+ message: string | null;
+ stack: string | null;
+}
+
export interface TestCaseResult {
name: string;
passed: boolean;
@@ -71,6 +79,8 @@ export async function runSingleTest(
});
await Deno.writeTextFile(tempFile, bundle);
+ const startTime = new Date().getTime();
+
const proc = Deno.run({
cmd: [
join(ROOT_PATH, `./target/${release ? "release" : "debug"}/deno`),
@@ -94,6 +104,8 @@ export async function runSingleTest(
const cases = [];
let stderr = "";
+ let harnessStatus = null;
+
const lines = readLines(proc.stderr);
for await (const line of lines) {
if (line.startsWith("{")) {
@@ -101,15 +113,21 @@ export async function runSingleTest(
const result = { ...data, passed: data.status == 0 };
cases.push(result);
reporter(result);
+ } else if (line.startsWith("#$#$#{")) {
+ harnessStatus = JSON.parse(line.slice(5));
} else {
stderr += line + "\n";
console.error(stderr);
}
}
+ const duration = new Date().getTime() - startTime;
+
const { code } = await proc.status();
return {
status: code,
+ harnessStatus,
+ duration,
cases,
stderr,
};