Skip to content

Commit

Permalink
fix makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
alexytsu committed Oct 3, 2023
1 parent addfd0a commit 5373ae9
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 23 deletions.
40 changes: 17 additions & 23 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,24 @@
WASM_EXCLUSION = \
--exclude greeter \
--exclude helix_integration_tests \
--exclude basic_token_actor \
--exclude basic_receiving_actor \
--exclude basic_nft_actor \
--exclude basic_transfer_actor \
--exclude frc46_test_actor \
--exclude frc46_factory_token \
--exclude frc53_test_actor

# actors are built to WASM via the helix_test_actors crate and be built individually as standalone
# crates so we exclude the from this convenience target
build: install-toolchain
cargo build --workspace
cargo build --workspace $(WASM_EXCLUSION)

check: install-toolchain
cargo fmt --check
cargo clippy --workspace -- -D warnings

check-build: check
cargo build --workspace
check-build: check build

# run all tests, this will not work if using RUSTFLAGS="-Zprofile" to generate profile info or coverage reports
# as any WASM targets will fail to build
Expand All @@ -16,16 +28,7 @@ test: install-toolchain
# tests excluding actors so we can generate coverage reports during CI build
# WASM targets such as actors do not support this so are excluded
test-coverage: install-toolchain
cargo test --workspace \
--exclude greeter \
--exclude helix_integration_tests \
--exclude basic_token_actor \
--exclude basic_receiving_actor \
--exclude basic_nft_actor \
--exclude basic_transfer_actor \
--exclude frc46_test_actor \
--exclude frc46_factory_token \
--exclude frc53_test_actor
cargo test --workspace $(WASM_EXCLUSION)

# separate actor testing stage to run from CI without coverage support
test-actors: install-toolchain
Expand All @@ -46,14 +49,5 @@ clean:
# install it with `cargo install grcov`
# TODO: fix the output path for LLVM_PROFILE_FILE
local-coverage:
CARGO_INCREMENTAL=0 RUSTFLAGS='-Cinstrument-coverage' LLVM_PROFILE_FILE='target/coverage/raw/cargo-test-%p-%m.profraw' cargo test --workspace \
--exclude greeter \
--exclude fil_token_integration_tests \
--exclude basic_token_actor \
--exclude basic_receiving_actor \
--exclude basic_nft_actor \
--exclude basic_transfer_actor \
--exclude frc46_test_actor \
--exclude frc46_factory_token \
--exclude frc53_test_actor
CARGO_INCREMENTAL=0 RUSTFLAGS='-Cinstrument-coverage' LLVM_PROFILE_FILE='target/coverage/raw/cargo-test-%p-%m.profraw' cargo test --workspace $(WASM_EXCLUSION)
grcov . --binary-path ./target/debug/deps/ -s . -t html --branch --ignore-not-existing --ignore '../*' --ignore "/*" -o target/coverage/html
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,8 @@ tokens, based on [frc46_token](./frc46_token/README.md) and implemented
Dual-licensed: [MIT](./LICENSE-MIT),
[Apache Software License v2](./LICENSE-APACHE).

## Testing

For local coverage testing, please install the `grcov` crate.

<sub>Copyright Protocol Labs, Inc, 2022</sub>

0 comments on commit 5373ae9

Please sign in to comment.