Convert wasmtime check into a compiletest needs directive
This commit is contained in:
parent
08853804d0
commit
12e999274d
@ -837,6 +837,7 @@ pub fn line_directive<'line>(
|
||||
"needs-sanitizer-thread",
|
||||
"needs-threads",
|
||||
"needs-unwind",
|
||||
"needs-wasmtime",
|
||||
"needs-xray",
|
||||
"no-prefer-dynamic",
|
||||
"normalize-stderr-32bit",
|
||||
|
@ -149,6 +149,11 @@ pub(super) fn handle_needs(
|
||||
condition: config.target_cfg().relocation_model == "pic",
|
||||
ignore_reason: "ignored on targets without PIC relocation model",
|
||||
},
|
||||
Need {
|
||||
name: "needs-wasmtime",
|
||||
condition: config.runner.as_ref().is_some_and(|r| r.contains("wasmtime")),
|
||||
ignore_reason: "ignored when wasmtime runner is not available",
|
||||
},
|
||||
];
|
||||
|
||||
let (name, comment) = match ln.split_once([':', ' ']) {
|
||||
|
@ -1,4 +1,5 @@
|
||||
//@ only-wasm32-wasip1
|
||||
//@ needs-wasmtime
|
||||
|
||||
extern crate run_make_support;
|
||||
|
||||
@ -11,15 +12,6 @@ fn main() {
|
||||
|
||||
let file = tmp_dir().join("foo.wasm");
|
||||
|
||||
let has_wasmtime = match Command::new("wasmtime").arg("--version").output() {
|
||||
Ok(s) => s.status.success(),
|
||||
_ => false,
|
||||
};
|
||||
if !has_wasmtime {
|
||||
println!("skipping test, wasmtime isn't available");
|
||||
return;
|
||||
}
|
||||
|
||||
run(&file, "return_two_i32", "1\n2\n");
|
||||
run(&file, "return_two_i64", "3\n4\n");
|
||||
run(&file, "return_two_f32", "5\n6\n");
|
||||
|
Loading…
Reference in New Issue
Block a user