mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-19 14:01:08 +01:00
19 lines
564 B
Rust
19 lines
564 B
Rust
#![cfg_attr(all(fuzzable_platform, fuzzing), no_main)]
|
|
|
|
#[cfg(all(fuzzable_platform, fuzzing))]
|
|
mod fuzz {
|
|
use libfuzzer_sys::fuzz_target;
|
|
|
|
fuzz_target!(|module: naga::Module| {
|
|
use naga::valid as v;
|
|
// Check if the module validates without errors.
|
|
//TODO: may also fuzz the flags and capabilities
|
|
let mut validator =
|
|
v::Validator::new(v::ValidationFlags::all(), v::Capabilities::default());
|
|
let _result = validator.validate(&module);
|
|
});
|
|
}
|
|
|
|
#[cfg(not(all(fuzzable_platform, fuzzing)))]
|
|
fn main() {}
|