MCPcopy Create free account
hub / github.com/Rust-GPU/rust-gpu / without_header_eq

Function without_header_eq

crates/rustc_codegen_spirv/src/linker/test.rs:179–215  ·  view source on GitHub ↗
(output: Module, expected: &str)

Source from the content-addressed store, hash-verified

177
178#[track_caller]
179fn without_header_eq(output: Module, expected: &str) {
180 let result = {
181 let disasm = |mut result: Module| {
182 use rspirv::binary::Disassemble;
183 //use rspirv::binary::Assemble;
184
185 // validate(&result.assemble());
186
187 result.header = None;
188 result.disassemble()
189 };
190 disasm(output)
191 };
192
193 let expected = expected
194 .split('\n')
195 .map(|l| l.trim())
196 .collect::<Vec<_>>()
197 .join("\n");
198
199 let result = result
200 .split('\n')
201 .map(|l| l.trim().replace(" ", " ")) // rspirv outputs multiple spaces between operands
202 .collect::<Vec<_>>()
203 .join("\n");
204
205 if result != expected {
206 println!("{}", &result);
207 panic!(
208 "assertion failed: `left == right`\
209 \n\
210 \n{}\
211 \n",
212 pretty_assertions::Comparison::new(&PrettyString(expected), &PrettyString(result))
213 );
214 }
215}
216
217#[test]
218fn standard() {

Callers 5

standardFunction · 0.85
not_a_lib_extra_exportsFunction · 0.85
func_ctrlFunction · 0.85
names_and_decorationsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected