()
| 55 | use wasmtime_cli_flags::CommonOptions; |
| 56 | |
| 57 | fn main() -> Result<()> { |
| 58 | if cfg!(miri) || cfg!(asan) { |
| 59 | return Ok(()); |
| 60 | } |
| 61 | |
| 62 | // There's not a ton of use in emulating these tests on other architectures |
| 63 | // since they only exercise architecture-independent code of compiling to |
| 64 | // multiple architectures. Additionally CI seems to occasionally deadlock or |
| 65 | // get stuck in these tests when using QEMU, and it's not entirely clear |
| 66 | // why. Finally QEMU-emulating these tests is relatively slow and without |
| 67 | // much benefit from emulation it's hard to justify this. In the end disable |
| 68 | // this test suite when QEMU is enabled. |
| 69 | if std::env::var("WASMTIME_TEST_NO_HOG_MEMORY").is_ok() { |
| 70 | return Ok(()); |
| 71 | } |
| 72 | |
| 73 | let _ = env_logger::try_init(); |
| 74 | |
| 75 | let mut tests = Vec::new(); |
| 76 | find_tests("./tests/disas".as_ref(), &mut tests)?; |
| 77 | |
| 78 | let mut trials = Vec::new(); |
| 79 | for test in tests { |
| 80 | trials.push(Trial::test(test.to_str().unwrap().to_string(), move || { |
| 81 | run_test(&test) |
| 82 | .with_context(|| format!("failed to run tests {test:?}")) |
| 83 | .map_err(|e| format!("{e:?}").into()) |
| 84 | })) |
| 85 | } |
| 86 | |
| 87 | // These tests have some long names so use the "quiet" output by default. |
| 88 | let mut arguments = Arguments::parse(); |
| 89 | if arguments.format.is_none() { |
| 90 | arguments.quiet = true; |
| 91 | } |
| 92 | libtest_mimic::run(&arguments, trials).exit() |
| 93 | } |
| 94 | |
| 95 | fn find_tests(path: &Path, dst: &mut Vec<PathBuf>) -> Result<()> { |
| 96 | for file in path |
nothing calls this directly
no test coverage detected