1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-03-09 15:50:02 +00:00

shtests: More speedups; also fix xtrace (re: 734e5953)

This reduces a bunch more unnecessarily long sleeps to give
asynchronous processes time to run, etc. (No, we don't need to be
compatible anymore with your cool 1985 Intel 80386DX 16 MHz
battlestation...) Running the test suite is almost tolerable now,
making me much more likely to actually run the regression test
suite and catch my own regressions.

In addition, there are various fixes to make the test suite
compatible with 'set -x' ('set -o xtrace') so that you can now
actually *use* the documented 'bin/shtests -x' option. Recommend
combining with '-p' to avoid tracing everything three times.

I've also added a really useful $PS4 trace prompt to shtests that
traces pretty much everything there is to trace. (It does use
expansions that modify ${.sh.match}, which affected several tests,
particularly in tests/substring.sh; for those we need to set a
temporary simpler $PS4.)

(cherry picked from commit c3a5d47cfe880b526cabb5370ddaced0e8626acd)
This commit is contained in:
Martijn Dekker 2020-06-08 23:02:26 +02:00
parent ba1f2ba9c3
commit 712261c89b
15 changed files with 178 additions and 120 deletions

View file

@ -47,9 +47,10 @@ if (( RANDOM==RANDOM || $RANDOM==$RANDOM ))
then err_exit RANDOM variable not working
fi
# SECONDS
sleep 3
if (( SECONDS < 2 ))
then err_exit SECONDS variable not working
let SECONDS=0.0
sleep .001
if (( SECONDS < .001 ))
then err_exit "either 'sleep' or \$SECONDS not working"
fi
# _
set abc def
@ -217,6 +218,7 @@ x error"
then err_exit "\${#$i} not correct"
fi
done
kill -s 0 $! || err_exit '$! does not point to latest asynchronous process'
kill $!
unset x
CDPATH=/
@ -433,12 +435,12 @@ fi
function foo
{
typeset SECONDS=0
sleep 1.5
sleep .002
print $SECONDS
}
x=$(foo)
(( x >1 && x < 2 ))
(( x >.001 && x < .01 ))
'
} 2> /dev/null || err_exit 'SECONDS not working in function'
cat > $tmp/script <<-\!