.PHONY: test test-coverage clean build
test:
cargo test
test-coverage:
cargo llvm-cov --all-features --lcov --output-path lcov.info --workspace
@echo "Coverage report generated: lcov.info"
check-coverage:
@coverage=$$(cargo llvm-cov --all-features --summary-only | grep -oP 'Total.*\K\d+\.\d+' | head -1); \
echo "Coverage: $${coverage}%"; \
if (( $$(echo "$${coverage} < 100.0" | bc -l) )); then \
echo "ERROR: Coverage is below 100% threshold"; \
exit 1; \
fi
build:
cargo build
clean:
cargo clean
lint:
cargo clippy --all-targets --all-features -- -D warnings
fmt:
cargo fmt --all
fmt-check:
cargo fmt --all -- --check