3
3
use crate :: utils:: get_compiler;
4
4
use std:: path:: Path ;
5
5
use wasmer:: { Features , Store } ;
6
- #[ cfg( feature = "jit" ) ]
6
+ #[ cfg( feature = "test- jit" ) ]
7
7
use wasmer_engine_jit:: JIT ;
8
- // #[cfg(feature = "native")]
9
- // use wasmer_engine_native::NativeEngine ;
8
+ #[ cfg( feature = "test- native" ) ]
9
+ use wasmer_engine_native:: Native ;
10
10
use wasmer_wast:: Wast ;
11
11
12
12
// The generated tests (from build.rs) look like:
@@ -28,6 +28,22 @@ fn _native_prefixer(bytes: &[u8]) -> String {
28
28
format ! ( "{}" , hash. to_hex( ) )
29
29
}
30
30
31
+ #[ cfg( feature = "test-jit" ) ]
32
+ fn get_store ( features : Features , try_nan_canonicalization : bool ) -> Store {
33
+ let compiler_config = get_compiler ( try_nan_canonicalization) ;
34
+ Store :: new ( & JIT :: new ( & compiler_config) . features ( features) . engine ( ) )
35
+ }
36
+
37
+ #[ cfg( feature = "test-native" ) ]
38
+ fn get_store ( features : Features , try_nan_canonicalization : bool ) -> Store {
39
+ let mut compiler_config = get_compiler ( try_nan_canonicalization) ;
40
+ Store :: new (
41
+ & Native :: new ( & mut compiler_config)
42
+ . features ( features)
43
+ . engine ( ) ,
44
+ )
45
+ }
46
+
31
47
pub fn run_wast ( wast_path : & str , compiler : & str ) -> anyhow:: Result < ( ) > {
32
48
println ! (
33
49
"Running wast `{}` with the {} compiler" ,
@@ -45,11 +61,7 @@ pub fn run_wast(wast_path: &str, compiler: &str) -> anyhow::Result<()> {
45
61
}
46
62
#[ cfg( feature = "test-singlepass" ) ]
47
63
features. multi_value ( false ) ;
48
- let compiler_config = get_compiler ( try_nan_canonicalization) ;
49
- let store = Store :: new ( & JIT :: new ( & compiler_config) . features ( features) . engine ( ) ) ;
50
- // let mut native = NativeEngine::new(compiler_config, tunables);
51
- // native.set_deterministic_prefixer(native_prefixer);
52
- // let store = Store::new(&native);
64
+ let store = get_store ( features, try_nan_canonicalization) ;
53
65
let mut wast = Wast :: new_with_spectest ( store) ;
54
66
if is_simd {
55
67
// We allow this, so tests can be run properly for `simd_const` test.
0 commit comments