mirror of
https://github.com/fluencelabs/parity-wasm
synced 2025-06-25 20:51:54 +00:00
arrange first bunch of tests
This commit is contained in:
@ -1,4 +1,8 @@
|
|||||||
language: rust
|
language: rust
|
||||||
|
script:
|
||||||
|
- cargo build --release --verbose
|
||||||
|
- cargo test --release --verbose
|
||||||
|
- cargo test --release --manifest-path=spec/Cargo.toml
|
||||||
after_success: |
|
after_success: |
|
||||||
cargo doc \
|
cargo doc \
|
||||||
&& echo '<meta http-equiv=refresh content=0;url=parity_wasm/index.html>' > target/doc/index.html && \
|
&& echo '<meta http-equiv=refresh content=0;url=parity_wasm/index.html>' > target/doc/index.html && \
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "parity-wasm-testsuite"
|
name = "parity-wasm-testsuite"
|
||||||
version = "0.5.6"
|
version = "0.0.0"
|
||||||
authors = ["NikVolf <nikvolf@gmail.com>"]
|
authors = ["NikVolf <nikvolf@gmail.com>"]
|
||||||
license = "MIT/Apache-2.0"
|
license = "MIT/Apache-2.0"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
|
@ -7,7 +7,4 @@ macro_rules! run_test {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
run_test!("br_if", wasm_br_if);
|
|
||||||
run_test!("block", wasm_block);
|
|
||||||
run_test!("i32", wasm_i32);
|
run_test!("i32", wasm_i32);
|
||||||
run_test!("address", wasm_address);
|
|
@ -83,6 +83,7 @@ pub fn spec(name: &str) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
for command in spec.commands.iter().skip(1) {
|
for command in spec.commands.iter().skip(1) {
|
||||||
|
println!("command {:?}", command);
|
||||||
match command {
|
match command {
|
||||||
&test::Command::Module { ref filename, .. } => {
|
&test::Command::Module { ref filename, .. } => {
|
||||||
let (_new_program, new_module) = setup_program(&outdir, &filename);
|
let (_new_program, new_module) = setup_program(&outdir, &filename);
|
||||||
|
@ -1,20 +1,20 @@
|
|||||||
#![cfg(test)]
|
#![cfg(test)]
|
||||||
|
|
||||||
#[derive(Deserialize)]
|
#[derive(Deserialize, Debug)]
|
||||||
pub struct RuntimeValue {
|
pub struct RuntimeValue {
|
||||||
#[serde(rename = "type")]
|
#[serde(rename = "type")]
|
||||||
pub value_type: String,
|
pub value_type: String,
|
||||||
pub value: String,
|
pub value: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Deserialize)]
|
#[derive(Deserialize, Debug)]
|
||||||
#[serde(tag = "type")]
|
#[serde(tag = "type")]
|
||||||
pub enum Action {
|
pub enum Action {
|
||||||
#[serde(rename = "invoke")]
|
#[serde(rename = "invoke")]
|
||||||
Invoke { field: String, args: Vec<RuntimeValue> }
|
Invoke { field: String, args: Vec<RuntimeValue> }
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Deserialize)]
|
#[derive(Deserialize, Debug)]
|
||||||
#[serde(tag = "type")]
|
#[serde(tag = "type")]
|
||||||
pub enum Command {
|
pub enum Command {
|
||||||
#[serde(rename = "module")]
|
#[serde(rename = "module")]
|
||||||
@ -33,7 +33,7 @@ pub enum Command {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Deserialize)]
|
#[derive(Deserialize, Debug)]
|
||||||
pub struct Spec {
|
pub struct Spec {
|
||||||
pub source_filename: String,
|
pub source_filename: String,
|
||||||
pub commands: Vec<Command>,
|
pub commands: Vec<Command>,
|
||||||
|
@ -538,7 +538,10 @@ fn f64_from_bits(mut v: u64) -> f64 {
|
|||||||
macro_rules! impl_integer_arithmetic_ops {
|
macro_rules! impl_integer_arithmetic_ops {
|
||||||
($type: ident) => {
|
($type: ident) => {
|
||||||
impl ArithmeticOps<$type> for $type {
|
impl ArithmeticOps<$type> for $type {
|
||||||
fn add(self, other: $type) -> $type { self.wrapping_add(other) }
|
fn add(self, other: $type) -> $type {
|
||||||
|
|
||||||
|
self.wrapping_add(other)
|
||||||
|
}
|
||||||
fn sub(self, other: $type) -> $type { self.wrapping_sub(other) }
|
fn sub(self, other: $type) -> $type { self.wrapping_sub(other) }
|
||||||
fn mul(self, other: $type) -> $type { self.wrapping_mul(other) }
|
fn mul(self, other: $type) -> $type { self.wrapping_mul(other) }
|
||||||
fn div(self, other: $type) -> Result<$type, Error> {
|
fn div(self, other: $type) -> Result<$type, Error> {
|
||||||
|
Reference in New Issue
Block a user