.PHONY: all tier1 tier2 tier3 test coverage mutation miri bench fmt lint audit clean help
all: tier2
tier1: check lint-fast test-unit
@echo "โ
Tier 1 passed (on-save feedback)"
check:
@echo "๐ Running cargo check..."
cargo check --all-targets
lint-fast:
@echo "๐ Running fast clippy..."
cargo clippy --lib -- -D warnings
test-unit:
@echo "๐งช Running unit tests..."
cargo test --lib -- --test-threads=4
tier2: fmt-check lint test coverage-check audit deny
@echo "โ
Tier 2 passed (on-commit validation)"
fmt-check:
@echo "๐ Checking formatting..."
cargo fmt --all --check
lint:
@echo "๐ Running full clippy..."
cargo clippy --all-targets -- -D warnings -D clippy::pedantic -D clippy::nursery \
-A clippy::module_name_repetitions \
-A clippy::must_use_candidate
test:
@echo "๐งช Running all tests..."
cargo test --all-targets
coverage-check:
@echo "๐ Checking coverage (target: 95%)..."
@command -v cargo-llvm-cov >/dev/null 2>&1 || { echo "Installing cargo-llvm-cov..."; cargo install cargo-llvm-cov; }
cargo llvm-cov --lib --fail-under 90
audit:
@echo "๐ Running security audit..."
@command -v cargo-audit >/dev/null 2>&1 || { echo "Installing cargo-audit..."; cargo install cargo-audit; }
cargo audit
deny:
@echo "๐ Checking dependencies..."
@command -v cargo-deny >/dev/null 2>&1 || { echo "Installing cargo-deny..."; cargo install cargo-deny; }
cargo deny check 2>/dev/null || echo "โ ๏ธ cargo-deny not configured (create deny.toml)"
tier3: tier2 mutation miri bench doc
@echo "โ
Tier 3 passed (on-merge exhaustive QA)"
mutation:
@echo "๐งฌ Running mutation testing (target: 80%)..."
@command -v cargo-mutants >/dev/null 2>&1 || { echo "Installing cargo-mutants..."; cargo install cargo-mutants; }
cargo mutants --timeout-multiplier 2.0 -- --lib
miri:
@echo "๐ฌ Running MIRI (undefined behavior check)..."
@rustup run nightly cargo miri test --lib 2>/dev/null || echo "โ ๏ธ MIRI requires nightly: rustup +nightly component add miri"
bench:
@echo "โฑ๏ธ Running benchmarks..."
cargo bench --no-run
doc:
@echo "๐ Building documentation..."
cargo doc --no-deps --document-private-items
coverage:
@echo "๐ Generating coverage report..."
@command -v cargo-llvm-cov >/dev/null 2>&1 || { echo "Installing cargo-llvm-cov..."; cargo install cargo-llvm-cov; }
cargo llvm-cov --lib --html
@echo "Coverage report: target/llvm-cov/html/index.html"
coverage-report:
@echo "๐ Full coverage report..."
cargo llvm-cov --lib --text
fmt:
@echo "๐ Formatting code..."
cargo fmt --all
proptest:
@echo "๐ฒ Running property tests (extended)..."
PROPTEST_CASES=1000 cargo test property_tests
chaos:
@echo "๐ช๏ธ Running chaos tests..."
PROPTEST_CASES=5000 cargo test property_tests
clean:
@echo "๐งน Cleaning..."
cargo clean
rm -rf target/llvm-cov target/criterion
ci-tier1:
@echo "๐ CI Tier 1..."
$(MAKE) tier1
ci-tier2:
@echo "๐ CI Tier 2..."
$(MAKE) tier2
ci-tier3:
@echo "๐ CI Tier 3..."
$(MAKE) tier3
help:
@echo "Manzana Build System (Iron Lotus Framework)"
@echo ""
@echo "Testing Tiers:"
@echo " make tier1 - ON-SAVE: Fast feedback (<3s)"
@echo " make tier2 - ON-COMMIT: Full validation (1-5min)"
@echo " make tier3 - ON-MERGE: Exhaustive QA (hours)"
@echo ""
@echo "Individual Commands:"
@echo " make check - Type check"
@echo " make lint - Run clippy"
@echo " make test - Run all tests"
@echo " make coverage - Generate coverage report"
@echo " make mutation - Run mutation testing"
@echo " make miri - Run MIRI (requires nightly)"
@echo " make bench - Run benchmarks"
@echo " make fmt - Format code"
@echo " make audit - Security audit"
@echo " make clean - Clean build artifacts"
@echo ""
@echo "CI:"
@echo " make ci-tier1 - CI tier 1 checks"
@echo " make ci-tier2 - CI tier 2 checks"
@echo " make ci-tier3 - CI tier 3 checks"