summaryrefslogtreecommitdiffstats
path: root/dom/webgpu/tests/cts/checkout/src/common/tools/validate.ts
blob: 164ee3259a3b5aef2d5aff0509c1fb351c1b0855 (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
31
32
33
34
35
36
import * as process from 'process';

import { crawl } from './crawl.js';

function usage(rc: number): void {
  console.error(`Usage: tools/validate [options] [SUITE_DIRS...]

For each suite in SUITE_DIRS, validate some properties about the file:
- It has a .description and .g
- That each test:
  - Has a test function (or is marked unimplemented)
  - Has no duplicate cases
  - Configures batching correctly, if used
- That each case query is not too long

Example:
  tools/validate src/unittests/ src/webgpu/

Options:
  --help          Print this message and exit.
`);
  process.exit(rc);
}

const args = process.argv.slice(2);
if (args.indexOf('--help') !== -1) {
  usage(0);
}

if (args.length < 1) {
  usage(0);
}

for (const suiteDir of args) {
  void crawl(suiteDir, true);
}