summaryrefslogtreecommitdiffstats
path: root/Justfile
diff options
context:
space:
mode:
authorBenjamin Sago <ogham@bsago.me>2020-10-17 20:39:44 +0100
committerBenjamin Sago <ogham@bsago.me>2020-10-17 21:12:18 +0100
commit61c5df7c111fc7451bf6b8f0dfdcb2b6b46577d0 (patch)
treec2d57fb8482a027e7543aa6ab3f89c2fede63eee /Justfile
parent86de17b788c676c08814441aac1becf2d2e40bdf (diff)
Use Specsheet for the extended tests
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.
Diffstat (limited to 'Justfile')
-rw-r--r--Justfile13
1 files changed, 11 insertions, 2 deletions
diff --git a/Justfile b/Justfile
index f7e5cc9..c5e1e67 100644
--- a/Justfile
+++ b/Justfile
@@ -1,5 +1,5 @@
-all: build test
-all-release: build-release test-release
+all: build test xtests
+all-release: build-release test-release xtests-release
# compiles the exa binary
@@ -28,6 +28,15 @@ all-release: build-release test-release
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