Adding shader test
This commit is contained in:
parent
cccc62e5a8
commit
0b9a68c906
|
@ -67,4 +67,22 @@ pub fn add_includes(source: &String) -> String {
|
|||
}
|
||||
|
||||
combined
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn preprocess_file() {
|
||||
// Generate a shader and preprocess it
|
||||
let mut source = read_to_string("src/shader.wgsl").unwrap();
|
||||
source = add_includes(&source);
|
||||
|
||||
// Parse the WGSL into a usable module
|
||||
let module = parse_wgsl(&source);
|
||||
|
||||
// Generate a valid WGSL string from the module
|
||||
let gen_wgsl = generate_wgsl(&module);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue