Skip to content

Commit 4a1d6df

Browse files
committed
Use wasmtime_test instead of test
This allows a couple of things: * Pre-configuring `Winch` as the strategy * Handling the target architetures supported by Winch
1 parent c93b944 commit 4a1d6df

File tree

3 files changed

+15
-20
lines changed

3 files changed

+15
-20
lines changed

tests/all/epoch_interruption.rs

+3-4
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ use anyhow::anyhow;
55
use std::sync::atomic::{AtomicBool, Ordering};
66
use std::sync::Arc;
77
use wasmtime::*;
8+
use wasmtime_test_macros::wasmtime_test;
89

910
fn build_engine() -> Arc<Engine> {
1011
let mut config = Config::new();
@@ -449,12 +450,10 @@ async fn drop_future_on_epoch_yield() {
449450
assert_eq!(true, alive_flag.load(Ordering::Acquire));
450451
}
451452

452-
#[test]
453+
#[wasmtime_test(strategies(not(Cranelift)))]
453454
#[cfg_attr(miri, ignore)]
454-
fn ensure_compatibility_between_winch_and_epoch() -> Result<()> {
455-
let mut config = Config::new();
455+
fn ensure_compatibility_between_winch_and_epoch(config: &mut Config) -> Result<()> {
456456
config.epoch_interruption(true);
457-
config.strategy(Strategy::Winch);
458457
let result = Engine::new(&config);
459458
match result {
460459
Ok(_) => anyhow::bail!("Expected incompatibility between epoch interruption and Winch"),

tests/all/fuel.rs

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
use wasmtime::*;
2+
use wasmtime_test_macros::wasmtime_test;
23
use wast::parser::{self, Parse, ParseBuffer, Parser};
34
use wast::token::Span;
45

@@ -257,12 +258,10 @@ fn get_fuel_clamps_at_zero() -> Result<()> {
257258
Ok(())
258259
}
259260

260-
#[test]
261+
#[wasmtime_test(strategies(not(Cranelift)))]
261262
#[cfg_attr(miri, ignore)]
262-
fn ensure_compatibility_between_winch_and_fuel() -> Result<()> {
263-
let mut config = Config::new();
263+
fn ensure_compatibility_between_winch_and_fuel(config: &mut Config) -> Result<()> {
264264
config.consume_fuel(true);
265-
config.strategy(Strategy::Winch);
266265
let result = Engine::new(&config);
267266
match result {
268267
Ok(_) => anyhow::bail!("Expected incompatibility between fuel and Winch"),

tests/all/winch_engine_features.rs

+9-12
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
use wasmtime::*;
2+
use wasmtime_test_macros::wasmtime_test;
23

3-
#[test]
4+
#[wasmtime_test(strategies(not(Cranelift)))]
45
#[cfg_attr(miri, ignore)]
5-
fn ensure_compatibility_between_winch_and_table_lazy_init() -> Result<()> {
6-
let mut config = Config::new();
6+
fn ensure_compatibility_between_winch_and_table_lazy_init(config: &mut Config) -> Result<()> {
77
config.table_lazy_init(false);
8-
config.strategy(Strategy::Winch);
98
let result = Engine::new(&config);
109
match result {
1110
Ok(_) => {
@@ -22,12 +21,10 @@ fn ensure_compatibility_between_winch_and_table_lazy_init() -> Result<()> {
2221
Ok(())
2322
}
2423

25-
#[test]
24+
#[wasmtime_test(strategies(not(Cranelift)))]
2625
#[cfg_attr(miri, ignore)]
27-
fn ensure_compatibility_between_winch_and_signals_based_traps() -> Result<()> {
28-
let mut config = Config::new();
26+
fn ensure_compatibility_between_winch_and_signals_based_traps(config: &mut Config) -> Result<()> {
2927
config.signals_based_traps(false);
30-
config.strategy(Strategy::Winch);
3128
let result = Engine::new(&config);
3229
match result {
3330
Ok(_) => {
@@ -46,12 +43,12 @@ fn ensure_compatibility_between_winch_and_signals_based_traps() -> Result<()> {
4643
Ok(())
4744
}
4845

49-
#[test]
46+
#[wasmtime_test(strategies(not(Cranelift)))]
5047
#[cfg_attr(miri, ignore)]
51-
fn ensure_compatibility_between_winch_and_generate_native_debuginfo() -> Result<()> {
52-
let mut config = Config::new();
48+
fn ensure_compatibility_between_winch_and_generate_native_debuginfo(
49+
config: &mut Config,
50+
) -> Result<()> {
5351
config.debug_info(true);
54-
config.strategy(Strategy::Winch);
5552
let result = Engine::new(&config);
5653
match result {
5754
Ok(_) => {

0 commit comments

Comments
 (0)