# Test runner justfile.
# Run `just` or `just help` to see available recipes.
set shell := ["bash", "-cu"]
set dotenv-load := true
set export := true
CARGO_FLAGS := ''
NO_STD_TARGET := 'thumbv7m-none-eabi'
banner MESSAGE:
@printf "\n\033[1m> %s\033[0m\n\n" "{{MESSAGE}}"
default: help
help:
@just --list --unsorted
fmt:
cargo fmt --all
lint:
cargo clippy {{CARGO_FLAGS}} --workspace --all-targets --all-features -- \
-W clippy::all -W clippy::cargo -D warnings
check-feature-matrix:
@just banner "Check lib (alloc, no default features)"
cargo check {{CARGO_FLAGS}} --workspace --lib --no-default-features --features alloc
@just banner "Check lib (json, no default features)"
cargo check {{CARGO_FLAGS}} --workspace --lib --no-default-features --features json
@just banner "Check lib (all features)"
cargo check {{CARGO_FLAGS}} --workspace --lib --all-features
check-no-std-target target=NO_STD_TARGET:
rustup target add {{target}}
@just banner "Check lib for {{target}} (alloc, no default features)"
cargo check {{CARGO_FLAGS}} --lib --target {{target}} --no-default-features --features alloc
@just banner "Check lib for {{target}} (json, no default features)"
cargo check {{CARGO_FLAGS}} --lib --target {{target}} --no-default-features --features json
test-offline +args='':
@just banner "Tests (all features)"
cargo test {{CARGO_FLAGS}} --workspace --all-features -- {{args}}
@just banner "Tests (alloc, no default features)"
cargo test {{CARGO_FLAGS}} --workspace --no-default-features --features alloc -- {{args}}
@just banner "Tests (json, no default features)"
cargo test {{CARGO_FLAGS}} --workspace --no-default-features --features json -- {{args}}
test +args='':
@just test-offline {{args}}
doc:
cargo doc {{CARGO_FLAGS}} --workspace --all-features --no-deps