diff --git a/Justfile b/Justfile index 32d4da5..3c62a73 100644 --- a/Justfile +++ b/Justfile @@ -1,74 +1,104 @@ -all: build test xtests -all-release: build-release test-release xtests-release +all: build test +all-release: build-release test-release -# compiles the exa binary +#----------# +# building # +#----------# + +# compile the exa binary @build: cargo build -# compiles the exa binary (in release mode) +# compile the exa binary (in release mode) @build-release: cargo build --release --verbose -# compiles the exa binary with every combination of feature flags -@build-features: - cargo hack build --feature-powerset +# produce an HTML chart of compilation timings +@build-time: + cargo +nightly clean + cargo +nightly build -Z timings + +# check that the exa binary can compile +@check: + cargo check -# runs unit tests +#---------------# +# running tests # +#---------------# + +# run unit tests @test: - cargo test --all -- --quiet + cargo test --workspace -- --quiet -# runs unit tests (in release mode) +# run unit tests (in release mode) @test-release: - cargo test --release --all --verbose - -# runs unit tests with every combination of feature flags -@test-features: - cargo hack test --feature-powerset -- --quiet + cargo test --workspace --release --verbose -# runs extended tests +#------------------------# +# running extended tests # +#------------------------# + +# run extended tests @xtests: xtests/run.sh -# runs extended tests (using the release mode exa) +# run extended tests (using the release mode exa) @xtests-release: xtests/run.sh --release +# display the number of extended tests that get run +@count-xtests: + grep -F '[[cmd]]' -R xtests | wc -l -# lints the code + +#-----------------------# +# code quality and misc # +#-----------------------# + +# lint the code @clippy: touch src/main.rs cargo clippy -# updates dependency versions, and checks for outdated ones +# update dependency versions, and checks for outdated ones @update-deps: cargo update command -v cargo-outdated >/dev/null || (echo "cargo-outdated not installed" && exit 1) cargo outdated -# lists unused dependencies +# list unused dependencies @unused-deps: command -v cargo-udeps >/dev/null || (echo "cargo-udeps not installed" && exit 1) cargo +nightly udeps -# prints versions of the necessary build tools +# check that every combination of feature flags is successful +@check-features: + command -v cargo-hack >/dev/null || (echo "cargo-hack not installed" && exit 1) + cargo hack check --feature-powerset + +# print versions of the necessary build tools @versions: rustc --version cargo --version -# builds the man pages +#---------------# +# documentation # +#---------------# + +# build the man pages @man: mkdir -p "${CARGO_TARGET_DIR:-target}/man" pandoc --standalone -f markdown -t man man/exa.1.md > "${CARGO_TARGET_DIR:-target}/man/exa.1" pandoc --standalone -f markdown -t man man/exa_colors.5.md > "${CARGO_TARGET_DIR:-target}/man/exa_colors.5" -# builds and previews the main man page (exa.1) +# build and preview the main man page (exa.1) @man-1-preview: man man "${CARGO_TARGET_DIR:-target}/man/exa.1" -# builds and previews the colour configuration man page (exa_colors.5) +# build and preview the colour configuration man page (exa_colors.5) @man-5-preview: man man "${CARGO_TARGET_DIR:-target}/man/exa_colors.5" diff --git a/xtests/run.sh b/xtests/run.sh index 83682d1..bbae83b 100755 --- a/xtests/run.sh +++ b/xtests/run.sh @@ -7,6 +7,11 @@ case "$1" in *) exa_binary="$HOME/target/debug/exa" ;; esac +if [ ! -e /vagrant ]; then + echo "The extended tests must be run on the Vagrant machine." + exit 1 +fi + if [ ! -f "$exa_binary" ]; then echo "exa binary ($exa_binary) does not exist" if [ "$1" != "--release" ]; then echo -e "create it first with \033[1;32mbuild-exa\033[0m or \033[1;32mb\033[0m"; fi