mirror of
https://github.com/Llewellynvdm/exa.git
synced 2024-11-25 13:27:33 +00:00
61c5df7c11
This commit changes the way the extended test suite is run. Previously, there was a folder full of outputs, and a script that ran exa repeatedly to check the outputs match. This script was hacked-together, with many problems: • It stops at the first failure, so if one test fails, you have no idea how many actually failed. • It also didn't actually show you the diff if one was different, it just checked it. • It combined stdout and stderr, and didn't test the exit status of exa. • All the output file names were just whatever I felt like calling the file at the time. • There is no way to only run a few of the tests — you have to run the whole thing each time. • There's no feel-good overall view where you see how many tests are passing. I started writing Specsheet to solve this problem (amongst other problems), and now, three and a half years later, it's finally ready for prime time. The tests are now defined as data rather than as a script. The outputs have a consistent naming convention (directory_flags.ansitxt), and they check stdout, stderr, and exit status separately. Specsheet also lets simple outputs (empty, non-empty, or one-line error messages) can be written inline rather than needing to be in files. So even though this pretty much runs the same tests as the run.sh script did, the tests are now more organised, making it easy to see where tests are missing and functionality is not being tested.
69 lines
1.6 KiB
Makefile
69 lines
1.6 KiB
Makefile
all: build test xtests
|
|
all-release: build-release test-release xtests-release
|
|
|
|
|
|
# compiles the exa binary
|
|
@build:
|
|
cargo build
|
|
|
|
# compiles 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
|
|
|
|
|
|
# runs unit tests
|
|
@test:
|
|
cargo test --all -- --quiet
|
|
|
|
# runs 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
|
|
|
|
|
|
# runs extended tests
|
|
@xtests:
|
|
xtests/run.sh
|
|
|
|
# runs extended tests (using the release mode exa)
|
|
@xtests-release:
|
|
xtests/run.sh --release
|
|
|
|
|
|
# lints the code
|
|
@clippy:
|
|
touch src/main.rs
|
|
cargo clippy
|
|
|
|
# updates dependency versions, and checks for outdated ones
|
|
@update:
|
|
cargo update
|
|
cargo outdated
|
|
|
|
# prints versions of the necessary build tools
|
|
@versions:
|
|
rustc --version
|
|
cargo --version
|
|
|
|
|
|
# builds 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)
|
|
@man-1-preview: man
|
|
man "${CARGO_TARGET_DIR:-target}/man/exa.1"
|
|
|
|
# builds and previews the colour configuration man page (exa_colors.5)
|
|
@man-5-preview: man
|
|
man "${CARGO_TARGET_DIR:-target}/man/exa_colors.5"
|