Skip to content

Commit 1119330

Browse files
committed
test: add WPT report test duration
1 parent 036c89f commit 1119330

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

test/common/wpt.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,13 @@ function codeUnitStr(char) {
5959
}
6060

6161
class ReportResult {
62+
#startTime;
63+
6264
constructor(name) {
6365
this.test = name;
6466
this.status = 'OK';
6567
this.subtests = [];
68+
this.#startTime = Date.now();
6669
}
6770

6871
addSubtest(name, status, message) {
@@ -81,6 +84,7 @@ class ReportResult {
8184

8285
finish(status) {
8386
this.status = status ?? 'OK';
87+
this.duration = Date.now() - this.#startTime;
8488
}
8589
}
8690

@@ -649,6 +653,7 @@ class WPTRunner {
649653
scriptsToRun.push(obj);
650654

651655
run(async () => {
656+
const startTime = Date.now();
652657
const worker = new Worker(workerPath, {
653658
execArgv: this.flags,
654659
workerData: {

0 commit comments

Comments
 (0)