Registers all functions in a [TestFile]. Additionally creates a trampoline for each one of them.
(&mut self, testfile: &TestFile)
| 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<()> { |