-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Build contracts with library feature-flags separately (#5)
- Loading branch information
Showing
11 changed files
with
212 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[submodule "tests/cw-plus"] | ||
path = tests/cw-plus | ||
url = https://github.com/CosmWasm/cw-plus.git |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
use anyhow::Result; | ||
|
||
use clap::Parser; | ||
use path_absolutize::Absolutize; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Integration Tests | ||
|
||
The integration tests run against [CosmWasm/cw-plus] and use [wabt] to verify the outputs. | ||
|
||
### Setup | ||
```sh | ||
$ brew install wabt | ||
$ git submodule update --init | ||
``` | ||
|
||
### Run | ||
```sh | ||
$ cargo run test | ||
``` | ||
|
||
[CosmWasm/cw-plus]: https://github.com/CosmWasm/cw-plus | ||
[wabt]: https://github.com/WebAssembly/wabt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
use glob::glob; | ||
use std::env; | ||
use std::process::{Command, Stdio}; | ||
|
||
#[test] | ||
fn it_can_compile_repo() { | ||
let cwd = env::current_dir().unwrap(); | ||
let manifest_path = &cwd.join("tests/cw-plus/Cargo.toml"); | ||
let res = cw_optimizoor::run(manifest_path); | ||
|
||
let wasm_pattern = &*cwd | ||
.join("tests/cw-plus/artifacts/*.wasm") | ||
.to_str() | ||
.unwrap_or_default() | ||
.to_string(); | ||
for entry in glob(wasm_pattern).expect("Failed to read glob pattern") { | ||
let path = format!("{}", entry.unwrap().display()); | ||
println!("{}", path); | ||
let decomp = Command::new("wasm-decompile") | ||
.arg(path) | ||
.stdout(Stdio::piped()) | ||
.spawn() | ||
.unwrap(); | ||
|
||
let grep = Command::new("grep") | ||
.arg("function execute") | ||
.stdin(decomp.stdout.unwrap()) | ||
.output() | ||
.unwrap(); | ||
|
||
assert!(grep.status.success()) | ||
} | ||
|
||
assert!(res.is_ok()); | ||
} |