summaryrefslogtreecommitdiffstats
path: root/dom/webgpu/tests/cts/checkout/docs/helper_index.txt
blob: 1b0a503246d18b530786c9c489c2a243d289a92d (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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
<!--
    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 common/framework/params_builder!CaseParamsBuilder} and {@link common/framework/params_builder!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 common/framework/params_builder!CaseParamsBuilder}:
        `ParamsBuilder` for adding "cases" to a test.
    - {@link common/framework/params_builder!CaseParamsBuilder#beginSubcases}:
        "Finalizes" the `CaseParamsBuilder`, returning a `SubcaseParamsBuilder`.
    - {@link common/framework/params_builder!SubcaseParamsBuilder}:
        `ParamsBuilder` for adding "subcases" to a test.

### Fixtures

(Uncheck the "Inherited" box to hide inherited methods from documentation pages.)

- {@link common/framework/fixture!Fixture}: Base fixture for all tests.
- {@link webgpu/gpu_test!GPUTest}: Base fixture for WebGPU tests.
- {@link webgpu/api/validation/validation_test!ValidationTest}: Base fixture for WebGPU validation tests.
- {@link webgpu/shader/validation/shader_validation_test!ShaderValidationTest}: Base fixture for WGSL shader validation tests.
- {@link webgpu/idl/idl_test!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 webgpu/gpu_test!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, OffscreenCanvas, 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/data_generation}: Helper for generating dummy texture data.
- {@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 a condition, otherwise throw an exception.
    - {@link common/util/util!unreachable}: Assert unreachable code.
    - {@link common/util/util!assertReject}, {@link common/util/util!resolveOnTimeout},
        {@link common/util/util!rejectOnTimeout},
        {@link common/util/util!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.