diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..8aa32a41 --- /dev/null +++ b/Makefile @@ -0,0 +1,25 @@ +# Makefile + +EXTRA_CARGO_ARGS ?= + +.PHONY: format clippy test test_nightly + +all: format clippy test test_nightly + +# Format code in-place using rustfmt. +format: + cargo fmt --all + +# Run clippy. +clippy: + cargo clippy --all --all-features --all-targets -- -D clippy::all + +# Run test available on stable toolchain. +test: + cargo test --all --features all_stable_except_failpoints ${EXTRA_CARGO_ARGS} -- --nocapture + cargo test --test failpoints --features all_stable ${EXTRA_CARGO_ARGS} -- --test-threads 1 --nocapture + +# Run test available on nightly toolchain. Assumes the default toolchain is nightly. +test_nightly: + cargo test --all --features all_except_failpoints ${EXTRA_CARGO_ARGS} -- --nocapture + cargo test --test failpoints --all-features ${EXTRA_CARGO_ARGS} -- --test-threads 1 --nocapture