On Wed, Aug 28, 2019 at 12:51:11PM +0200, Karel Zak wrote: > Maybe the best and most robust solution would be split stdout and > stderr into two files for each test. Now we have $TS_OUTPUT, what about > to replace it with $TS_STDOUT and $TS_STDERR? Something like: > > - $TS_CMD_MOUNT $DEVICE $TS_MOUNTPOINT >> $TS_OUTPUT 2>&1 > + $TS_CMD_MOUNT $DEVICE $TS_MOUNTPOINT >> $TS_STDOUT 2>> $TS_STDERR > > And also create tests/expected/<foo>/<bar>{.err} for tests where any > output on stderr is expected, otherwise assume $TS_STDERR is empty. > > This change will be pretty invasive, but than we can easily compare > outputs and keep track about what is where printed. Implemented. So, the voodoo with (un)buffered output is no more necessary. The last remaining problem is colctl, see: https://travis-ci.org/karelzak/util-linux/jobs/578940843 diff-{{{ --- /home/travis/build/karelzak/util-linux/tests/expected/colcrt/regressions-hang1 2019-08-30 18:48:16.236479052 +0000 +++ /home/travis/build/karelzak/util-linux/tests/output/colcrt/regressions-hang1 2019-08-30 18:51:50.046236386 +0000 @@ -1,3 +1 @@ -789:;<=>=>?IABUVNXYZ[ `abcdefgg !"#$%&'()*+,-./01234)*:,-./0123456789:;[=>?1234)*:,-./0123456789:;[=>?4456789:;<=>?IABUVN`abcdefg !" - - -return value: 0 +return value: 124 }}}-diff ... for some reason it returns nothing, but $? is 124. The problem is elapsed timeout, but why? timeout 2 env LC_ALL=C.UTF-8 $TS_CMD_COLCRT < $1 >> $TS_OUTPUT 2>> $TS_ERRLOG echo "return value: $?" >> $TS_OUTPUT Karel -- Karel Zak <kzak@xxxxxxxxxx> http://karelzak.blogspot.com