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

Function new_subtest

cranelift/filetests/src/lib.rs:87–104  ·  view source on GitHub ↗

Create a new subcommand trait object to match `parsed.command`. This function knows how to create all of the possible `test ` commands that can appear in a `.clif` test file.

(parsed: &TestCommand)

Source from the content-addressed store, hash-verified

85/// This function knows how to create all of the possible `test <foo>` commands that can appear in
86/// a `.clif` test file.
87fn new_subtest(parsed: &TestCommand) -> anyhow::Result<Box<dyn subtest::SubTest>> {
88 match parsed.command {
89 "alias-analysis" => test_alias_analysis::subtest(parsed),
90 "cat" => test_cat::subtest(parsed),
91 "compile" => test_compile::subtest(parsed),
92 "domtree" => test_domtree::subtest(parsed),
93 "inline" => test_inline::subtest(parsed),
94 "interpret" => test_interpret::subtest(parsed),
95 "legalizer" => test_legalizer::subtest(parsed),
96 "optimize" => test_optimize::subtest(parsed),
97 "print-cfg" => test_print_cfg::subtest(parsed),
98 "run" => test_run::subtest(parsed),
99 "safepoint" => test_safepoint::subtest(parsed),
100 "unwind" => test_unwind::subtest(parsed),
101 "verifier" => test_verifier::subtest(parsed),
102 _ => anyhow::bail!("unknown test command '{}'", parsed.command),
103 }
104}
105
106fn pretty_anyhow_error(
107 func: &cranelift_codegen::ir::Function,

Callers

nothing calls this directly

Calls 1

subtestFunction · 0.70

Tested by

no test coverage detected