Running parametrized JSON tests
This commit is contained in:
@@ -1,11 +1,31 @@
|
||||
//! Evm factory.
|
||||
|
||||
use std::fmt;
|
||||
use evm::Evm;
|
||||
|
||||
#[derive(Clone)]
|
||||
pub enum VMType {
|
||||
Jit,
|
||||
Interpreter
|
||||
}
|
||||
impl fmt::Display for VMType {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
write!(f, "{}", match *self {
|
||||
VMType::Jit => "JIT",
|
||||
VMType::Interpreter => "INT"
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
impl VMType {
|
||||
#[cfg(feature="jit")]
|
||||
pub fn all() -> Vec<VMType> {
|
||||
vec![VMType::Jit, VMType::Interpreter]
|
||||
}
|
||||
#[cfg(not(feature="jit"))]
|
||||
pub fn all() -> Vec<VMType> {
|
||||
vec![VMType::Interpreter]
|
||||
}
|
||||
}
|
||||
|
||||
/// Evm factory. Creates appropriate Evm.
|
||||
pub struct Factory {
|
||||
|
||||
Reference in New Issue
Block a user