From d6258d867f0627a065c1a4010f8164318371f196 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Thu, 30 Dec 2021 10:34:49 +0200 Subject: test: if test.py fails, tail log For easier debugging in CI. Sponsored-by: author --- check | 28 ++++++++++++++-------------- 1 file 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." -- cgit v1.2.1