Running parametrized JSON tests

This commit is contained in:
Tomusdrw
2016-01-14 18:29:18 +01:00
parent d3a71d3058
commit 4c1b8ddd8f
2 changed files with 39 additions and 7 deletions

View File

@@ -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 {