1
1
mirror of https://github.com/walles/moar.git synced 2024-07-07 08:36:29 +03:00

Add a manual test suite

This commit is contained in:
Johan Walles 2024-06-30 09:29:10 +02:00
parent 3543b2ca5f
commit 3c39daf7ad
2 changed files with 44 additions and 0 deletions

View File

@ -186,6 +186,12 @@ Run tests:
./test.sh
```
Launch the manual test suite:
```bash
./manual-test.sh
```
To run tests in 32 bit mode, either do `GOARCH=386 ./test.sh` if you're on
Linux, or `docker build . -f Dockerfile-test-386` (tested on macOS).

38
manual-test.sh Executable file
View File

@ -0,0 +1,38 @@
#!/bin/bash
set -e -o pipefail
# Test all permutations of the following:
# - Read from file vs from stdin
# - 'q' to quit vs 'v' to launch an editor
# - Terminal editor (nano) or GUI editor (code -w)
read -r -p "Press enter to start testing, then q to exit the pager"
clear
# With --trace we always get a non-zero exit code
./moar.sh --trace moar.sh || true
echo
read -r -p "Press enter to continue, then q to exit the pager"
clear
./moar.sh --trace <moar.sh || true
echo
read -r -p "Press enter to continue, then v to launch a terminal editor, then exit that"
clear
EDITOR=nano ./moar.sh --trace moar.sh || true
echo
read -r -p "Press enter to continue, then v to launch a terminal editor, then exit that"
clear
EDITOR=nano ./moar.sh --trace <moar.sh || true
echo
read -r -p "Press enter to continue, then v to launch a GUI editor, then exit that"
clear
EDITOR="code -w" ./moar.sh --trace moar.sh || true
echo
read -r -p "Press enter to continue, then v to launch a GUI editor, then exit that"
clear
EDITOR="code -w" ./moar.sh --trace <moar.sh || true