@@ -99,12 +99,18 @@ The library provides helper types for common test patterns:
9999- ` WgpuComputeTestMultiBuffer ` - Multi-buffer compute shader test with input/output
100100 separation
101101- ` WgpuComputeTestPushConstant ` - Compute shader test with push constants support
102+ - ` Skip ` - Marks a test variant as skipped with a reason
102103
103104** Shader source types:**
104105
105106- ` RustComputeShader ` - Compiles the current crate as a Rust GPU shader
106107- ` WgslComputeShader ` - Loads WGSL shader from file (shader.wgsl or compute.wgsl)
107108
109+ ** Backend types:**
110+
111+ - ` WgpuBackend ` - Default wgpu-based compute backend
112+ - ` VulkanoBackend ` - Vulkano-based compute backend (useful for testing different GPU drivers)
113+
108114For examples, see:
109115
110116- [ ` tests/lang/core/ops/math_ops/ ` ] ( tests/lang/core/ops/math_ops/ ) - Multi-buffer test
@@ -205,6 +211,40 @@ The harness automatically writes human-readable `.txt` files alongside binary ou
205211For floating-point data (F32/F64), these show the array values in decimal format. For
206212raw/integer data, these show the values as hex bytes or integers
207213
214+ ## Skipping Tests on Specific Platforms
215+
216+ Sometimes a test variant needs to be skipped on certain platforms (e.g., due to driver
217+ issues or platform limitations). The difftest framework provides a clean way to handle
218+ this using the ` Skip ` scaffolding type:
219+
220+ ``` rust
221+ use difftest :: scaffold :: Skip ;
222+
223+ fn main () {
224+ let config = Config :: from_path (std :: env :: args (). nth (1 ). unwrap ()). unwrap ();
225+
226+ // Skip on macOS due to platform-specific issues
227+ #[cfg(target_os = " macos" )]
228+ {
229+ let skip = Skip :: new (" This test is not supported on macOS" );
230+ skip . run_test (& config ). unwrap ();
231+ return ;
232+ }
233+
234+ // Run the actual test on other platforms
235+ #[cfg(not(target_os = " macos" ))]
236+ {
237+ // ... normal test implementation ...
238+ }
239+ }
240+ ```
241+
242+ When a test is skipped:
243+ - The skip reason is recorded in the test metadata
244+ - The test runner logs the skip reason
245+ - The test doesn't contribute to the output comparison
246+ - If all variants are skipped, the test fails with an error
247+
208248## Harness logs
209249
210250If you suspect a bug in the test harness, you can view detailed test harness logs:
0 commit comments