summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/mozilla/tests/webgpu/common/internal/logging/logger.js
blob: 224af20ddc58f3d3fd22d8c8ba97bac1bcab6e5c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/**
* AUTO-GENERATED - DO NOT EDIT. Source: https://github.com/gpuweb/cts
**/import { version } from '../version.js';
import { TestCaseRecorder } from './test_case_recorder.js';



export class Logger {
  static globalDebugMode = false;


  results = new Map();

  constructor({ overrideDebugMode } = {}) {
    this.overriddenDebugMode = overrideDebugMode;
  }

  record(name) {
    const result = { status: 'running', timems: -1 };
    this.results.set(name, result);
    return [
    new TestCaseRecorder(result, this.overriddenDebugMode ?? Logger.globalDebugMode),
    result];

  }

  asJSON(space) {
    return JSON.stringify({ version, results: Array.from(this.results) }, undefined, space);
  }
}