helper_index.txt (5339B)
1 <!-- 2 View this file in Typedoc! 3 4 - At https://gpuweb.github.io/cts/docs/tsdoc/ 5 - Or locally: 6 - npm run tsdoc 7 - npm start 8 - http://localhost:8080/docs/tsdoc/ 9 10 This file is parsed as a tsdoc. 11 --> 12 13 ## Index of Test Helpers 14 15 This index is a quick-reference of helper functions in the test suite. 16 Use it to determine whether you can reuse a helper, instead of writing new code, 17 to improve readability and reviewability. 18 19 Whenever a new generally-useful helper is added, it should be indexed here. 20 21 **See linked documentation for full helper listings.** 22 23 - {@link common/framework/params_builder!CaseParamsBuilder} and {@link common/framework/params_builder!SubcaseParamsBuilder}: 24 Combinatorial generation of test parameters. They are iterated by the test framework at runtime. 25 See `examples.spec.ts` for basic examples of how this behaves. 26 - {@link common/framework/params_builder!CaseParamsBuilder}: 27 `ParamsBuilder` for adding "cases" to a test. 28 - {@link common/framework/params_builder!CaseParamsBuilder#beginSubcases}: 29 "Finalizes" the `CaseParamsBuilder`, returning a `SubcaseParamsBuilder`. 30 - {@link common/framework/params_builder!SubcaseParamsBuilder}: 31 `ParamsBuilder` for adding "subcases" to a test. 32 33 ### Fixtures 34 35 (Uncheck the "Inherited" box to hide inherited methods from documentation pages.) 36 37 - {@link common/framework/fixture!Fixture}: Base fixture for all tests. 38 - {@link webgpu/gpu_test!GPUTest}: Base fixture for WebGPU tests. 39 - {@link webgpu/api/validation/validation_test!ValidationTest}: Base fixture for WebGPU validation tests. 40 - {@link webgpu/shader/validation/shader_validation_test!ShaderValidationTest}: Base fixture for WGSL shader validation tests. 41 - {@link webgpu/idl/idl_test!IDLTest}: 42 Base fixture for testing the exposed interface is correct (without actually using WebGPU). 43 44 ### WebGPU Helpers 45 46 - {@link webgpu/capability_info}: Structured information about texture formats, binding types, etc. 47 - {@link webgpu/constants}: 48 Constant values (needed anytime a WebGPU constant is needed outside of a test function). 49 - {@link webgpu/util/texture}: Helpers for GPUTextures. 50 - {@link webgpu/util/unions}: Helpers for various union typedefs in the WebGPU spec. 51 - {@link webgpu/util/math}: Helpers for common math operations. 52 - {@link webgpu/util/check_contents}: Check the contents of TypedArrays, with nice messages. 53 Also can be composed with {@link webgpu/gpu_test!GPUTest#expectGPUBufferValuesPassCheck}, used to implement 54 GPUBuffer checking helpers in GPUTest. 55 - {@link webgpu/util/conversion}: Numeric encoding/decoding for float/unorm/snorm values, etc. 56 - {@link webgpu/util/copy_to_texture}: 57 Helper class for copyToTexture test suites for execution copy and check results. 58 - {@link webgpu/util/color_space_conversion}: 59 Helper functions to do color space conversion. The algorithm is the same as defined in 60 CSS Color Module Level 4. 61 - {@link webgpu/util/create_elements}: 62 Helpers for creating web elements like HTMLCanvasElement, OffscreenCanvas, etc. 63 - {@link webgpu/util/shader}: Helpers for creating fragment shader based on intended output values, plainType, and componentCount. 64 - {@link webgpu/util/prng}: Seed-able deterministic pseudo random number generator. Replacement for Math.random(). 65 - {@link webgpu/util/texture/base}: General texture-related helpers. 66 - {@link webgpu/util/texture/data_generation}: Helper for generating dummy texture data. 67 - {@link webgpu/util/texture/layout}: Helpers for working with linear image data 68 (like in copyBufferToTexture, copyTextureToBuffer, writeTexture). 69 - {@link webgpu/util/texture/subresource}: Helpers for working with texture subresource ranges. 70 - {@link webgpu/util/texture/texel_data}: Helpers encoding/decoding texel formats. 71 - {@link webgpu/util/texture/texel_view}: Helper class to create and view texture data through various representations. 72 - {@link webgpu/util/texture/texture_ok}: Helpers for checking texture contents. 73 - {@link webgpu/shader/types}: Helpers for WGSL data types. 74 - {@link webgpu/shader/execution/expression/expression}: Helpers for WGSL expression execution tests. 75 - {@link webgpu/web_platform/util}: Helpers for web platform features (e.g. video elements). 76 77 ### General Helpers 78 79 - {@link common/framework/resources}: Provides the path to the `resources/` directory. 80 - {@link common/util/navigator_gpu}: Finds and returns the `navigator.gpu` object or equivalent. 81 - {@link common/util/util}: Miscellaneous utilities. 82 - {@link common/util/util!assert}: Assert a condition, otherwise throw an exception. 83 - {@link common/util/util!unreachable}: Assert unreachable code. 84 - {@link common/util/util!assertReject}, {@link common/util/util!resolveOnTimeout}, 85 {@link common/util/util!rejectOnTimeout}, 86 {@link common/util/util!raceWithRejectOnTimeout}, and more. 87 - {@link common/util/collect_garbage}: 88 Attempt to trigger garbage collection, for testing that garbage collection is not observable. 89 - {@link common/util/preprocessor}: A simple template-based, non-line-based preprocessor, 90 implementing if/elif/else/endif. Possibly useful for WGSL shader generation. 91 - {@link common/util/timeout}: Use this instead of `setTimeout`. 92 - {@link common/util/types}: Type metaprogramming helpers.