From 47ce01b6f3dc9ffc32613db1ffde70d3b81b0afc Mon Sep 17 00:00:00 2001 From: tabokie Date: Tue, 2 Aug 2022 13:35:58 +0800 Subject: [PATCH] add makefile Signed-off-by: tabokie --- Makefile | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 Makefile 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