MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / add_testfile

Method add_testfile

cranelift/filetests/src/function_runner.rs:171–181  ·  view source on GitHub ↗

Registers all functions in a [TestFile]. Additionally creates a trampoline for each one of them.

(&mut self, testfile: &TestFile)

Source from the content-addressed store, hash-verified

169 /// Registers all functions in a [TestFile]. Additionally creates a trampoline for each one
170 /// of them.
171 pub fn add_testfile(&mut self, testfile: &TestFile) -> Result<()> {
172 let functions = testfile
173 .functions
174 .iter()
175 .map(|(f, _)| f)
176 .cloned()
177 .collect::<Vec<_>>();
178
179 self.add_functions(&functions[..], Vec::new())?;
180 Ok(())
181 }
182
183 /// Declares a function an registers it as a linkable and callable target internally
184 pub fn declare_function(&mut self, func: &Function) -> Result<()> {

Callers 2

compile_testfileFunction · 0.80
run_file_contentsFunction · 0.80

Calls 5

OkFunction · 0.85
add_functionsMethod · 0.80
newFunction · 0.50
mapMethod · 0.45
iterMethod · 0.45

Tested by 1

compile_testfileFunction · 0.64