summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/mozilla/tests/webgpu/common/internal/logging/logger.js
blob: 4ec505cb69720c98786d85cd497bba9abe2705bf (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
/**
* AUTO-GENERATED - DO NOT EDIT. Source: https://github.com/gpuweb/cts
**/import { globalTestConfig } from '../../framework/test_config.js';import { version } from '../version.js';

import { TestCaseRecorder } from './test_case_recorder.js';



export class Logger {

  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 ?? globalTestConfig.enableDebugLogs),
    result];

  }

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