]> wagner.pp.ru Git - openssl-gost/engine.git/commitdiff
tcl_tests: Abbreviate output when run under CI
authorVitaly Chikunov <vt@altlinux.org>
Sun, 5 Jan 2020 20:51:09 +0000 (23:51 +0300)
committerDmitry Belyavskiy <beldmit@users.noreply.github.com>
Sat, 11 Jan 2020 21:20:37 +0000 (00:20 +0300)
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

tcl_tests/runtest.sh

index a9714fd768fef2a5cebe7b7ea45fee64a0dd832a..9e0dead1b7abc96194803b2cbd43eb4015badb09 100644 (file)
@@ -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