From c91cb3fff9f19e8647e72e407310feaa6e7d633f Mon Sep 17 00:00:00 2001 From: NikVolf Date: Mon, 5 Jun 2017 19:23:49 +0300 Subject: [PATCH] invoke action --- spec/src/fixtures.rs | 1 + spec/src/run.rs | 12 ++++++++++-- spec/src/test.rs | 5 +++++ 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/spec/src/fixtures.rs b/spec/src/fixtures.rs index 12bd46e..9c70e08 100644 --- a/spec/src/fixtures.rs +++ b/spec/src/fixtures.rs @@ -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); diff --git a/spec/src/run.rs b/spec/src/run.rs index b943580..70e9da7 100644 --- a/spec/src/run.rs +++ b/spec/src/run.rs @@ -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) + } + } + }, } } } diff --git a/spec/src/test.rs b/spec/src/test.rs index baa21c9..1a839aa 100644 --- a/spec/src/test.rs +++ b/spec/src/test.rs @@ -36,6 +36,11 @@ pub enum Command { line: u64, filename: String, text: String, + }, + #[serde(rename = "action")] + Action { + line: u64, + action: Action, } }