diff options
Diffstat (limited to 'dom/webgpu/tests/cts/checkout/tools')
-rw-r--r-- | dom/webgpu/tests/cts/checkout/tools/checklist | 11 | ||||
-rw-r--r-- | dom/webgpu/tests/cts/checkout/tools/dev_server | 4 | ||||
-rw-r--r-- | dom/webgpu/tests/cts/checkout/tools/gen_cache | 4 | ||||
-rw-r--r-- | dom/webgpu/tests/cts/checkout/tools/gen_listings | 7 | ||||
-rw-r--r-- | dom/webgpu/tests/cts/checkout/tools/gen_version | 33 | ||||
-rw-r--r-- | dom/webgpu/tests/cts/checkout/tools/gen_wpt_cts_html | 39 | ||||
-rw-r--r-- | dom/webgpu/tests/cts/checkout/tools/presubmit | 4 | ||||
-rw-r--r-- | dom/webgpu/tests/cts/checkout/tools/run_deno | 3 | ||||
-rw-r--r-- | dom/webgpu/tests/cts/checkout/tools/run_node | 6 | ||||
-rw-r--r-- | dom/webgpu/tests/cts/checkout/tools/run_wpt_ref_tests | 4 |
10 files changed, 115 insertions, 0 deletions
diff --git a/dom/webgpu/tests/cts/checkout/tools/checklist b/dom/webgpu/tests/cts/checkout/tools/checklist new file mode 100644 index 0000000000..8aace4f387 --- /dev/null +++ b/dom/webgpu/tests/cts/checkout/tools/checklist @@ -0,0 +1,11 @@ +#!/usr/bin/env node + +// Takes a list of queries and checks that: +// - Every query matches something in the repository +// - Every case in the repository matches exactly one query +// This is used to ensure that tracking spreadsheet is complete (not missing any tests) +// and every query in it is valid (e.g. renames have been applied, and new tests added +// to the spreadsheet have also been added to the CTS). + +require('../src/common/tools/setup-ts-in-node.js'); +require('../src/common/tools/checklist.ts'); diff --git a/dom/webgpu/tests/cts/checkout/tools/dev_server b/dom/webgpu/tests/cts/checkout/tools/dev_server new file mode 100644 index 0000000000..d400d79c19 --- /dev/null +++ b/dom/webgpu/tests/cts/checkout/tools/dev_server @@ -0,0 +1,4 @@ +#!/usr/bin/env node + +require('../src/common/tools/setup-ts-in-node.js'); +require('../src/common/tools/dev_server.ts'); diff --git a/dom/webgpu/tests/cts/checkout/tools/gen_cache b/dom/webgpu/tests/cts/checkout/tools/gen_cache new file mode 100644 index 0000000000..fd7bf52c2f --- /dev/null +++ b/dom/webgpu/tests/cts/checkout/tools/gen_cache @@ -0,0 +1,4 @@ +#!/usr/bin/env node + +require('../src/common/tools/setup-ts-in-node.js'); +require('../src/common/tools/gen_cache.ts'); diff --git a/dom/webgpu/tests/cts/checkout/tools/gen_listings b/dom/webgpu/tests/cts/checkout/tools/gen_listings new file mode 100644 index 0000000000..6c25622423 --- /dev/null +++ b/dom/webgpu/tests/cts/checkout/tools/gen_listings @@ -0,0 +1,7 @@ +#!/usr/bin/env node + +// Crawl a suite directory (e.g. src/webgpu/) to generate a listing.js containing +// the listing of test files in the suite. + +require('../src/common/tools/setup-ts-in-node.js'); +require('../src/common/tools/gen_listings.ts'); diff --git a/dom/webgpu/tests/cts/checkout/tools/gen_version b/dom/webgpu/tests/cts/checkout/tools/gen_version new file mode 100644 index 0000000000..b35f236f31 --- /dev/null +++ b/dom/webgpu/tests/cts/checkout/tools/gen_version @@ -0,0 +1,33 @@ +#!/usr/bin/env node + +// Get the current git hash, and save (overwrite) it into out/framework/version.js +// so it can be read when running inside the browser. + +/* eslint-disable no-console */ + +require('../src/common/tools/setup-ts-in-node.js'); +const fs = require('fs'); + +const myself = 'tools/gen_version'; +if (!fs.existsSync(myself)) { + console.error('Must be run from repository root'); + process.exit(1); +} + +const { version } = require('../src/common/tools/version.ts'); + +fs.mkdirSync('./out/common/framework', { recursive: true }); +// Overwrite the version.js generated by TypeScript compilation. +fs.writeFileSync( + './out/common/internal/version.js', + `\ +// AUTO-GENERATED - DO NOT EDIT. See ${myself}. + +export const version = '${version}'; +` +); + +// Since the generated version.js was overwritten, its source map is no longer relevant. +try { + fs.unlinkSync('./out/common/internal/version.js.map'); +} catch (ex) { } diff --git a/dom/webgpu/tests/cts/checkout/tools/gen_wpt_cts_html b/dom/webgpu/tests/cts/checkout/tools/gen_wpt_cts_html new file mode 100644 index 0000000000..07f1f465c7 --- /dev/null +++ b/dom/webgpu/tests/cts/checkout/tools/gen_wpt_cts_html @@ -0,0 +1,39 @@ +#!/usr/bin/env node + +// Generate a top-level cts.https.html file for WPT. +// +// In the default invocation (used by grunt), just generates a cts.https.html with one "variant" +// per test spec file (.spec.ts). +// +// In the advanced invocation, generate a list of variants, which are broken down as much as needed +// to accommodate a provided list of suppressions, and no further. This reduces the total runtime of +// the test suite by not generating an entire page load for every single test case. +// The resulting cts.https.html can be checked in and used to run tests within browser harnesses. +// +// For example, for the following 9 cases: +// +// webgpu:a/foo:foo1={"x":1} +// webgpu:a/foo:foo1={"x":2} +// webgpu:a/foo:foo2={"x":1} +// webgpu:a/foo:foo2={"x":2} +// webgpu:a/bar:bar1={"x":1} +// webgpu:a/bar:bar1={"x":2} +// webgpu:a/bar:bar1={"x":3} +// webgpu:a/bar:bar2={"x":1} +// webgpu:a/bar:bar2={"x":2} +// +// and the following suppressions: +// +// [ Win ] ?q=webgpu:a/bar:bar1={"x":1} [ Failure ] +// [ Mac ] ?q=webgpu:a/bar:bar1={"x":3} [ Failure ] +// +// the following list of 5 variants gives enough granularity to suppress only the failing cases: +// +// ?q=webgpu:a/foo: +// ?q=webgpu:a/bar:bar1={"x":1} <- [ Win ] +// ?q=webgpu:a/bar:bar1={"x":2} +// ?q=webgpu:a/bar:bar1={"x":3} <- [ Mac ] +// ?q=webgpu:a/bar:bar2~ + +require('../src/common/tools/setup-ts-in-node.js'); +require('../src/common/tools/gen_wpt_cts_html.ts'); diff --git a/dom/webgpu/tests/cts/checkout/tools/presubmit b/dom/webgpu/tests/cts/checkout/tools/presubmit new file mode 100644 index 0000000000..a2a3b78690 --- /dev/null +++ b/dom/webgpu/tests/cts/checkout/tools/presubmit @@ -0,0 +1,4 @@ +#!/usr/bin/env node + +require('../src/common/tools/setup-ts-in-node.js'); +require('../src/common/tools/presubmit.ts'); diff --git a/dom/webgpu/tests/cts/checkout/tools/run_deno b/dom/webgpu/tests/cts/checkout/tools/run_deno new file mode 100644 index 0000000000..8cc89a475c --- /dev/null +++ b/dom/webgpu/tests/cts/checkout/tools/run_deno @@ -0,0 +1,3 @@ +#!/usr/bin/env -S deno run --unstable --allow-read --allow-write --allow-env --allow-net=deno.land --no-check + +import '../out/common/runtime/cmdline.js';
\ No newline at end of file diff --git a/dom/webgpu/tests/cts/checkout/tools/run_node b/dom/webgpu/tests/cts/checkout/tools/run_node new file mode 100644 index 0000000000..b71ec9f134 --- /dev/null +++ b/dom/webgpu/tests/cts/checkout/tools/run_node @@ -0,0 +1,6 @@ +#!/usr/bin/env node + +// Run test suites under node. + +require('../src/common/tools/setup-ts-in-node.js'); +require('../src/common/runtime/cmdline.ts'); diff --git a/dom/webgpu/tests/cts/checkout/tools/run_wpt_ref_tests b/dom/webgpu/tests/cts/checkout/tools/run_wpt_ref_tests new file mode 100644 index 0000000000..79fd1b1b7c --- /dev/null +++ b/dom/webgpu/tests/cts/checkout/tools/run_wpt_ref_tests @@ -0,0 +1,4 @@ +#!/usr/bin/env node + +require('../src/common/tools/setup-ts-in-node.js'); +require('../src/common/tools/run_wpt_ref_tests.ts'); |