Runs the entire subtest for a given target, invokes [Self::run] for running individual tests.
(
&self,
testfile: &TestFile,
file_update: &mut FileUpdate,
file_path: &'a str,
flags: &'a Flags,
isa: Option<&'a dyn TargetIsa>,
)
| 215 | /// Runs the entire subtest for a given target, invokes [Self::run] for running |
| 216 | /// individual tests. |
| 217 | fn run_target<'a>( |
| 218 | &self, |
| 219 | testfile: &TestFile, |
| 220 | file_update: &mut FileUpdate, |
| 221 | file_path: &'a str, |
| 222 | flags: &'a Flags, |
| 223 | isa: Option<&'a dyn TargetIsa>, |
| 224 | ) -> anyhow::Result<()> { |
| 225 | // Disable runtests with pinned reg enabled. |
| 226 | // We've had some abi issues that the trampoline isn't quite ready for. |
| 227 | if flags.enable_pinned_reg() { |
| 228 | return Err(anyhow::anyhow!( |
| 229 | [ |
| 230 | "Cannot run runtests with pinned_reg enabled.", |
| 231 | "See https://github.com/bytecodealliance/wasmtime/issues/4376 for more info" |
| 232 | ] |
| 233 | .join("\n") |
| 234 | )); |
| 235 | } |
| 236 | |
| 237 | // Check that the host machine can run this test case (i.e. has all extensions) |
| 238 | let host_isa = build_host_isa(true, flags.clone(), vec![]).ok(); |
| 239 | if let Err(e) = is_isa_compatible(file_path, host_isa.as_deref(), isa.unwrap()) { |
| 240 | log::info!("{e}"); |
| 241 | return Ok(()); |
| 242 | } |
| 243 | |
| 244 | let compiled_testfile = compile_testfile(&testfile, flags, isa.unwrap())?; |
| 245 | |
| 246 | for (func, details) in &testfile.functions { |
| 247 | info!( |
| 248 | "Test: {}({}) {}", |
| 249 | self.name(), |
| 250 | func.name, |
| 251 | isa.map_or("-", TargetIsa::name) |
| 252 | ); |
| 253 | |
| 254 | let context = Context { |
| 255 | preamble_comments: &testfile.preamble_comments, |
| 256 | details, |
| 257 | flags, |
| 258 | isa, |
| 259 | file_path: file_path.as_ref(), |
| 260 | file_update, |
| 261 | }; |
| 262 | |
| 263 | run_test(&compiled_testfile, &func, &context).context(self.name())?; |
| 264 | } |
| 265 | |
| 266 | Ok(()) |
| 267 | } |
| 268 | |
| 269 | fn run(&self, _func: Cow<ir::Function>, _context: &Context) -> anyhow::Result<()> { |
| 270 | unreachable!() |
no test coverage detected