From: Vitaly Chikunov Date: Sun, 5 Jan 2020 20:51:09 +0000 (+0300) Subject: tcl_tests: Abbreviate output when run under CI X-Git-Tag: v3.0.0~238 X-Git-Url: http://wagner.pp.ru/gitweb/?a=commitdiff_plain;h=07743c1340bebbaba78525d0d22c9104732c3f1d;p=openssl-gost%2Fengine.git tcl_tests: Abbreviate output when run under CI To make CI output not too long - output only header of every test set and output only relevant log entries on test failures. When `CI' env is defined. Which should be defined for both Travis and Cirrus. Reference: https://docs.travis-ci.com/user/environment-variables/ https://cirrus-ci.org/guide/writing-tasks/#environment-variables --- diff --git a/tcl_tests/runtest.sh b/tcl_tests/runtest.sh index a9714fd..9e0dead 100644 --- a/tcl_tests/runtest.sh +++ b/tcl_tests/runtest.sh @@ -120,7 +120,21 @@ if [ "$*" ]; then exit $fail fi for t in $BASE_TESTS; do - $TCLSH $t.try || fail=1 + if [ "$CI" ]; then + if $TCLSH $t.try > $TESTDIR/$t.out 2>&1; then + head -1 $TESTDIR/$t.out + else + fail=1 + cat $TESTDIR/$t.out + echo "=== Output failures of $TESTDIR/$t.log ===" + awk "/ ends failed/" RS= ORS='\n\n' $TESTDIR/$t.log | + sed 's/^/\t/' + echo "=== End of $TESTDIR/$t.log ===" + exit 1 + fi + else + $TCLSH $t.try || fail=1 + fi done if false; then # ignore some tests for a time