blob: d248e7aa88f02be63f45f490dd0f6cf4b780e9a8 [file] [log] [blame]
<!--
View this file in Typedoc!
- At https://gpuweb.github.io/cts/docs/tsdoc/
- Or locally:
- npm run tsdoc
- npm start
- http://localhost:8080/docs/tsdoc/
This file is parsed as a tsdoc.
-->
## Index of Test Helpers
This index is a quick-reference of helper functions in the test suite.
Use it to determine whether you can reuse a helper, instead of writing new code,
to improve readability and reviewability.
Whenever a new generally-useful helper is added, it should be indexed here.
**See linked documentation for full helper listings.**
- {@link CaseParamsBuilder} and {@link SubcaseParamsBuilder}:
Combinatorial generation of test parameters. They are iterated by the test framework at runtime.
See `examples.spec.ts` for basic examples of how this behaves.
- {@link CaseParamsBuilder}: `ParamsBuilder` for adding "cases" to a test.
- {@link CaseParamsBuilder.beginSubcases}:
"Finalizes" the `CaseParamsBuilder`, returning a `SubcaseParamsBuilder`.
- {@link SubcaseParamsBuilder}: `ParamsBuilder` for adding "subcases" to a test.
### Fixtures
(Uncheck the "Inherited" box to hide inherited methods from documentation pages.)
- {@link Fixture}: Base fixture for all tests.
- {@link GPUTest}: Base fixture for WebGPU tests.
- {@link ValidationTest}: Base fixture for WebGPU validation tests.
- {@link ShaderValidationTest}: Base fixture for WGSL shader validation tests.
- {@link IDLTest}:
Base fixture for testing the exposed interface is correct (without actually using WebGPU).
### WebGPU Helpers
- {@link webgpu/capability_info}: Structured information about texture formats, binding types, etc.
- {@link webgpu/constants}:
Constant values (needed anytime a WebGPU constant is needed outside of a test function).
- {@link webgpu/util/buffer}: Helpers for GPUBuffers.
- {@link webgpu/util/texture}: Helpers for GPUTextures.
- {@link webgpu/util/unions}: Helpers for various union typedefs in the WebGPU spec.
- {@link webgpu/util/math}: Helpers for common math operations.
- {@link webgpu/util/check_contents}: Check the contents of TypedArrays, with nice messages.
Also can be composed with {@link GPUTest.expectGPUBufferValuesPassCheck}, used to implement
GPUBuffer checking helpers in GPUTest.
- {@link webgpu/util/conversion}: Numeric encoding/decoding for float/unorm/snorm values, etc.
- {@link webgpu/util/copy_to_texture}:
Helper class for copyToTexture test suites for execution copy and check results.
- {@link webgpu/util/color_space_conversion}:
Helper functions to do color space conversion. The algorithm is the same as defined in
CSS Color Module Level 4.
- {@link webgpu/util/create_elements}:
Helpers for creating web elements like HTMLCanvasElement, OffscrrenCanvas, etc.
- {@link webgpu/util/shader}: Helpers for creating fragment shader based on intended output values, plainType, and componentCount.
- {@link webgpu/util/texture/base}: General texture-related helpers.
- {@link webgpu/util/texture/layout}: Helpers for working with linear image data
(like in copyBufferToTexture, copyTextureToBuffer, writeTexture).
- {@link webgpu/util/texture/subresource}: Helpers for working with texture subresource ranges.
- {@link webgpu/util/texture/texel_data}: Helpers encoding/decoding texel formats.
- {@link webgpu/util/texture/texel_view}: Helper class to create and view texture data through various representations.
- {@link webgpu/util/texture/texture_ok}: Helpers for checking texture contents.
- {@link webgpu/shader/types}: Helpers for WGSL data types.
- {@link webgpu/shader/execution/expression/expression}: Helpers for WGSL expression execution tests.
- {@link webgpu/web_platform/util}: Helpers for web platform features (e.g. video elements).
### General Helpers
- {@link common/framework/resources}: Provides the path to the `resources/` directory.
- {@link common/util/navigator_gpu}: Finds and returns the `navigator.gpu` object or equivalent.
- {@link common/util/util}: Miscellaneous utilities.
- {@link common/util/util.assert | assert}: Assert a condition, otherwise throw an exception.
- {@link common/util/util.unreachable | unreachable}: Assert unreachable code.
- {@link assertReject}, {@link resolveOnTimeout}, {@link rejectOnTimeout},
{@link raceWithRejectOnTimeout}, and more.
- {@link common/util/collect_garbage}:
Attempt to trigger garbage collection, for testing that garbage collection is not observable.
- {@link common/util/preprocessor}: A simple template-based, non-line-based preprocessor,
implementing if/elif/else/endif. Possibly useful for WGSL shader generation.
- {@link common/util/timeout}: Use this instead of `setTimeout`.
- {@link common/util/types}: Type metaprogramming helpers.