summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2021-12-30 10:34:49 +0200
committerLars Wirzenius <liw@liw.fi>2021-12-30 10:34:49 +0200
commitd6258d867f0627a065c1a4010f8164318371f196 (patch)
treeb18be01130ea1409711b9cc407516c43892f3d62
parentef5d694949cd5184267d70acb3ade2675abe3259 (diff)
downloadsummain-rs-d6258d867f0627a065c1a4010f8164318371f196.tar.gz
test: if test.py fails, tail log
For easier debugging in CI. Sponsored-by: author
-rwxr-xr-xcheck28
1 files changed, 14 insertions, 14 deletions
diff --git a/check b/check
index da9330e..0830900 100755
--- a/check
+++ b/check
@@ -6,24 +6,21 @@ set -euo pipefail
quiet=-q
hideok=
-if command -v chronic > /dev/null
-then
- hideok=chronic
+if command -v chronic >/dev/null; then
+ hideok=chronic
fi
-if [ "$#" -gt 0 ]
-then
- case "$1" in
+if [ "$#" -gt 0 ]; then
+ case "$1" in
verbose | -v | --verbose)
- quiet=
- hideok=
- ;;
- esac
+ quiet=
+ hideok=
+ ;;
+ esac
fi
-got_cargo_cmd()
-{
- cargo --list | grep " $1 " > /dev/null
+got_cargo_cmd() {
+ cargo --list | grep " $1 " >/dev/null
}
# shellcheck disable=2086
@@ -38,6 +35,9 @@ subplot docgen summain.md -o summain.pdf
subplot codegen summain.md -o test.py
rm -f test.log
-$hideok python3 test.py --log test.log "$@"
+if ! $hideok python3 test.py --log test.log "$@"; then
+ tail -n500 test.log
+ exit 1
+fi
echo "Everything seems to be in order."