Skip to content

Commit f078c75

Browse files
authored
Allow using wasmtime wast builtins on the CLI (#13065)
Add a flag that hooks them up to help share reproducible test cases.
1 parent b2fd5de commit f078c75

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

src/commands/wast.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@ pub struct WastCommand {
3737
/// Wasmtime itself.
3838
#[arg(long = "async", require_equals = true, value_name = "true|false")]
3939
async_: Option<Option<bool>>,
40+
41+
/// Whether or not to enable wasmtime's builtin functions for the `*.wast`
42+
/// to import.
43+
#[arg(long = "wasmtime-builtins")]
44+
wasmtime_builtins: bool,
4045
}
4146

4247
impl WastCommand {
@@ -81,6 +86,10 @@ impl WastCommand {
8186
wast_context.precompile_load(path);
8287
}
8388

89+
if self.wasmtime_builtins {
90+
wast_context.register_wasmtime()?;
91+
}
92+
8493
for script in self.scripts.iter() {
8594
wast_context
8695
.run_file(script)

0 commit comments

Comments
 (0)