invoke action

This commit is contained in:
NikVolf 2017-06-05 19:23:49 +03:00
parent dfd6152cda
commit c91cb3fff9
3 changed files with 16 additions and 2 deletions

View File

@ -10,3 +10,4 @@ macro_rules! run_test {
run_test!("i32", wasm_i32);
run_test!("endianness", wasm_endianness);
run_test!("i64", wasm_i64);
run_test!("address", wasm_address);

View File

@ -140,14 +140,22 @@ pub fn spec(name: &str) {
&test::Command::AssertInvalid { line, ref filename, .. } => {
let module_load = try_load(&outdir, filename);
match module_load {
Ok(result) => {
Ok(_) => {
panic!("Expected invalid module definition, got some module!")
},
Err(e) => {
println!("assert_invalid at line {} - success ({:?})", line, e)
}
}
}
},
&test::Command::Action { line, ref action } => {
match run_action(&*module, action) {
Ok(_) => { },
Err(e) => {
panic!("Failed to invoke action at line {}: {:?}", line, e)
}
}
},
}
}
}

View File

@ -36,6 +36,11 @@ pub enum Command {
line: u64,
filename: String,
text: String,
},
#[serde(rename = "action")]
Action {
line: u64,
action: Action,
}
}