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

Function main

tests/disas.rs:57–93  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

55use wasmtime_cli_flags::CommonOptions;
56
57fn 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
95fn find_tests(path: &Path, dst: &mut Vec<PathBuf>) -> Result<()> {
96 for file in path

Callers

nothing calls this directly

Calls 15

OkFunction · 0.85
is_okMethod · 0.80
to_strMethod · 0.80
with_contextMethod · 0.80
find_testsFunction · 0.70
run_testFunction · 0.70
newFunction · 0.50
testFunction · 0.50
parseFunction · 0.50
runFunction · 0.50
as_refMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected