mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-19 22:11:01 +01:00
[spv-out] Add initial Rosetta test (#181)
* [spv-out] Add initial Rosetta test For now just check that spv-out succeeds * [spv-out] Check spv output has len > 0
This commit is contained in:
1 parent
e1e116537e
commit
2fa8eb596d
2 files changed
+20
No files matched your search
@@ -9,6 +9,9 @@ mod test_framework;
|
||||
#[cfg(test)]
|
||||
mod layout_tests;
|
||||
|
||||
#[cfg(all(test, feature = "deserialize"))]
|
||||
mod rosetta_tests;
|
||||
|
||||
pub use writer::Writer;
|
||||
|
||||
use spirv::*;
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
use std::{fs, path::Path};
|
||||
|
||||
const TEST_PATH: &str = "test-data";
|
||||
|
||||
fn rosetta_test(file_name: &str) {
|
||||
let test_dir = Path::new(TEST_PATH);
|
||||
let input = fs::read_to_string(test_dir.join(file_name)).unwrap();
|
||||
let module: crate::Module = ron::de::from_str(&input).unwrap();
|
||||
|
||||
let spv = super::Writer::new(&module.header, super::WriterFlags::NONE).write(&module);
|
||||
assert!(spv.len() > 0, "spv.len() > 0");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn simple() {
|
||||
rosetta_test("simple/simple.expected.ron")
|
||||
}
|
||||
Reference in new issue
Block a user