mirror of
https://github.com/fluencelabs/wasm-utils
synced 2025-06-02 17:41:20 +00:00
Fix tests and cli
This commit is contained in:
parent
d6f82000ee
commit
af2d61b9f8
@ -34,7 +34,7 @@ name = "wasm-pack"
|
|||||||
path = "pack/main.rs"
|
path = "pack/main.rs"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
parity-wasm = "0.30"
|
parity-wasm = "0.31"
|
||||||
pwasm-utils = { path = "..", version = "0.2" }
|
pwasm-utils = { path = "..", version = "0.2" }
|
||||||
glob = "0.2"
|
glob = "0.2"
|
||||||
clap = "2.24"
|
clap = "2.24"
|
||||||
|
28
src/gas.rs
28
src/gas.rs
@ -271,7 +271,7 @@ mod tests {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn simple_grow() {
|
fn simple_grow() {
|
||||||
use parity_wasm::elements::Opcode::*;
|
use parity_wasm::elements::Instruction::*;
|
||||||
|
|
||||||
let module = builder::module()
|
let module = builder::module()
|
||||||
.global()
|
.global()
|
||||||
@ -280,7 +280,7 @@ mod tests {
|
|||||||
.function()
|
.function()
|
||||||
.signature().param().i32().build()
|
.signature().param().i32().build()
|
||||||
.body()
|
.body()
|
||||||
.with_opcodes(elements::Opcodes::new(
|
.with_instructions(elements::Instructions::new(
|
||||||
vec![
|
vec![
|
||||||
GetGlobal(0),
|
GetGlobal(0),
|
||||||
GrowMemory(0),
|
GrowMemory(0),
|
||||||
@ -326,7 +326,7 @@ mod tests {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn grow_no_gas_no_track() {
|
fn grow_no_gas_no_track() {
|
||||||
use parity_wasm::elements::Opcode::*;
|
use parity_wasm::elements::Instruction::*;
|
||||||
|
|
||||||
let module = builder::module()
|
let module = builder::module()
|
||||||
.global()
|
.global()
|
||||||
@ -335,7 +335,7 @@ mod tests {
|
|||||||
.function()
|
.function()
|
||||||
.signature().param().i32().build()
|
.signature().param().i32().build()
|
||||||
.body()
|
.body()
|
||||||
.with_opcodes(elements::Opcodes::new(
|
.with_instructions(elements::Instructions::new(
|
||||||
vec![
|
vec![
|
||||||
GetGlobal(0),
|
GetGlobal(0),
|
||||||
GrowMemory(0),
|
GrowMemory(0),
|
||||||
@ -369,7 +369,7 @@ mod tests {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn simple() {
|
fn simple() {
|
||||||
use parity_wasm::elements::Opcode::*;
|
use parity_wasm::elements::Instruction::*;
|
||||||
|
|
||||||
let module = builder::module()
|
let module = builder::module()
|
||||||
.global()
|
.global()
|
||||||
@ -378,7 +378,7 @@ mod tests {
|
|||||||
.function()
|
.function()
|
||||||
.signature().param().i32().build()
|
.signature().param().i32().build()
|
||||||
.body()
|
.body()
|
||||||
.with_opcodes(elements::Opcodes::new(
|
.with_instructions(elements::Instructions::new(
|
||||||
vec![
|
vec![
|
||||||
GetGlobal(0),
|
GetGlobal(0),
|
||||||
End
|
End
|
||||||
@ -405,7 +405,7 @@ mod tests {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn nested() {
|
fn nested() {
|
||||||
use parity_wasm::elements::Opcode::*;
|
use parity_wasm::elements::Instruction::*;
|
||||||
|
|
||||||
let module = builder::module()
|
let module = builder::module()
|
||||||
.global()
|
.global()
|
||||||
@ -414,7 +414,7 @@ mod tests {
|
|||||||
.function()
|
.function()
|
||||||
.signature().param().i32().build()
|
.signature().param().i32().build()
|
||||||
.body()
|
.body()
|
||||||
.with_opcodes(elements::Opcodes::new(
|
.with_instructions(elements::Instructions::new(
|
||||||
vec![
|
vec![
|
||||||
GetGlobal(0),
|
GetGlobal(0),
|
||||||
Block(elements::BlockType::NoResult),
|
Block(elements::BlockType::NoResult),
|
||||||
@ -455,7 +455,7 @@ mod tests {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn ifelse() {
|
fn ifelse() {
|
||||||
use parity_wasm::elements::Opcode::*;
|
use parity_wasm::elements::Instruction::*;
|
||||||
|
|
||||||
let module = builder::module()
|
let module = builder::module()
|
||||||
.global()
|
.global()
|
||||||
@ -464,7 +464,7 @@ mod tests {
|
|||||||
.function()
|
.function()
|
||||||
.signature().param().i32().build()
|
.signature().param().i32().build()
|
||||||
.body()
|
.body()
|
||||||
.with_opcodes(elements::Opcodes::new(
|
.with_instructions(elements::Instructions::new(
|
||||||
vec![
|
vec![
|
||||||
GetGlobal(0),
|
GetGlobal(0),
|
||||||
If(elements::BlockType::NoResult),
|
If(elements::BlockType::NoResult),
|
||||||
@ -513,7 +513,7 @@ mod tests {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn call_index() {
|
fn call_index() {
|
||||||
use parity_wasm::elements::Opcode::*;
|
use parity_wasm::elements::Instruction::*;
|
||||||
|
|
||||||
let module = builder::module()
|
let module = builder::module()
|
||||||
.global()
|
.global()
|
||||||
@ -526,7 +526,7 @@ mod tests {
|
|||||||
.function()
|
.function()
|
||||||
.signature().param().i32().build()
|
.signature().param().i32().build()
|
||||||
.body()
|
.body()
|
||||||
.with_opcodes(elements::Opcodes::new(
|
.with_instructions(elements::Instructions::new(
|
||||||
vec![
|
vec![
|
||||||
Call(0),
|
Call(0),
|
||||||
If(elements::BlockType::NoResult),
|
If(elements::BlockType::NoResult),
|
||||||
@ -576,7 +576,7 @@ mod tests {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn forbidden() {
|
fn forbidden() {
|
||||||
use parity_wasm::elements::Opcode::*;
|
use parity_wasm::elements::Instruction::*;
|
||||||
|
|
||||||
let module = builder::module()
|
let module = builder::module()
|
||||||
.global()
|
.global()
|
||||||
@ -585,7 +585,7 @@ mod tests {
|
|||||||
.function()
|
.function()
|
||||||
.signature().param().i32().build()
|
.signature().param().i32().build()
|
||||||
.body()
|
.body()
|
||||||
.with_opcodes(elements::Opcodes::new(
|
.with_instructions(elements::Instructions::new(
|
||||||
vec![
|
vec![
|
||||||
F32Const(555555),
|
F32Const(555555),
|
||||||
End
|
End
|
||||||
|
@ -435,7 +435,7 @@ mod tests {
|
|||||||
.function()
|
.function()
|
||||||
.signature().param().i32().build()
|
.signature().param().i32().build()
|
||||||
.body()
|
.body()
|
||||||
.with_opcodes(elements::Instructions::new(
|
.with_instructions(elements::Instructions::new(
|
||||||
vec![
|
vec![
|
||||||
elements::Instruction::GetGlobal(0),
|
elements::Instruction::GetGlobal(0),
|
||||||
elements::Instruction::End
|
elements::Instruction::End
|
||||||
@ -477,7 +477,7 @@ mod tests {
|
|||||||
.function()
|
.function()
|
||||||
.signature().param().i32().build()
|
.signature().param().i32().build()
|
||||||
.body()
|
.body()
|
||||||
.with_opcodes(elements::Instructions::new(
|
.with_instructions(elements::Instructions::new(
|
||||||
vec![
|
vec![
|
||||||
elements::Instruction::GetGlobal(1),
|
elements::Instruction::GetGlobal(1),
|
||||||
elements::Instruction::End
|
elements::Instruction::End
|
||||||
@ -510,7 +510,7 @@ mod tests {
|
|||||||
.function()
|
.function()
|
||||||
.signature().param().i32().build()
|
.signature().param().i32().build()
|
||||||
.body()
|
.body()
|
||||||
.with_opcodes(elements::Instructions::new(
|
.with_instructions(elements::Instructions::new(
|
||||||
vec![
|
vec![
|
||||||
elements::Instruction::Call(1),
|
elements::Instruction::Call(1),
|
||||||
elements::Instruction::End
|
elements::Instruction::End
|
||||||
@ -563,7 +563,7 @@ mod tests {
|
|||||||
.function()
|
.function()
|
||||||
.signature().param().i32().build()
|
.signature().param().i32().build()
|
||||||
.body()
|
.body()
|
||||||
.with_opcodes(elements::Instructions::new(
|
.with_instructions(elements::Instructions::new(
|
||||||
vec![
|
vec![
|
||||||
elements::Instruction::CallIndirect(1, 0),
|
elements::Instruction::CallIndirect(1, 0),
|
||||||
elements::Instruction::End
|
elements::Instruction::End
|
||||||
|
@ -249,7 +249,7 @@ mod test {
|
|||||||
.function()
|
.function()
|
||||||
.signature().build()
|
.signature().build()
|
||||||
.body()
|
.body()
|
||||||
.with_opcodes(elements::Instructions::new(
|
.with_instructions(elements::Instructions::new(
|
||||||
vec![
|
vec![
|
||||||
elements::Instruction::End
|
elements::Instruction::End
|
||||||
]
|
]
|
||||||
@ -259,7 +259,7 @@ mod test {
|
|||||||
.function()
|
.function()
|
||||||
.signature().build()
|
.signature().build()
|
||||||
.body()
|
.body()
|
||||||
.with_opcodes(elements::Instructions::new(
|
.with_instructions(elements::Instructions::new(
|
||||||
vec![
|
vec![
|
||||||
elements::Instruction::End
|
elements::Instruction::End
|
||||||
]
|
]
|
||||||
@ -298,7 +298,7 @@ mod test {
|
|||||||
.function()
|
.function()
|
||||||
.signature().build()
|
.signature().build()
|
||||||
.body()
|
.body()
|
||||||
.with_opcodes(elements::Instructions::new(
|
.with_instructions(elements::Instructions::new(
|
||||||
vec![
|
vec![
|
||||||
elements::Instruction::End
|
elements::Instruction::End
|
||||||
]
|
]
|
||||||
@ -308,7 +308,7 @@ mod test {
|
|||||||
.function()
|
.function()
|
||||||
.signature().build()
|
.signature().build()
|
||||||
.body()
|
.body()
|
||||||
.with_opcodes(elements::Instructions::new(
|
.with_instructions(elements::Instructions::new(
|
||||||
vec![
|
vec![
|
||||||
elements::Instruction::End
|
elements::Instruction::End
|
||||||
]
|
]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user