mirror of
https://github.com/mii443/wasmer.git
synced 2025-08-28 11:19:25 +00:00
Separate testing per compiler
This commit is contained in:
29
tests/compilers/utils.rs
Normal file
29
tests/compilers/utils.rs
Normal file
@ -0,0 +1,29 @@
|
||||
use std::sync::Arc;
|
||||
use test_utils::get_compiler_config_from_str;
|
||||
use wasmer::{Features, Store, Tunables};
|
||||
use wasmer_engine_jit::JITEngine;
|
||||
|
||||
fn get_compiler_str() -> &'static str {
|
||||
cfg_if::cfg_if! {
|
||||
if #[cfg(feature = "test-cranelift")] {
|
||||
"cranelift"
|
||||
} else if #[cfg(feature = "test-llvm")] {
|
||||
"llvm"
|
||||
} else if #[cfg(feature = "test-singlepass")] {
|
||||
"singlepass"
|
||||
}
|
||||
else {
|
||||
compile_error!("No compiler chosen for the tests")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_store() -> Store {
|
||||
let features = Features::default();
|
||||
let try_nan_canonicalization = false;
|
||||
let compiler_config =
|
||||
get_compiler_config_from_str(get_compiler_str(), try_nan_canonicalization, features);
|
||||
let tunables = Tunables::for_target(compiler_config.target().triple());
|
||||
let store = Store::new(Arc::new(JITEngine::new(compiler_config, tunables)));
|
||||
store
|
||||
}
|
Reference in New Issue
Block a user