Two new functions:

* place_summary_first copies the regrtest summary to the front of the file
    making it easier to scan quickly for problems.

  * count_failures gets the actual count of the number of failing tests, not
    just a 1 (some failures) or 0 (no failures).
This commit is contained in:
Skip Montanaro 2008-02-15 19:03:59 +00:00
parent 3f91437e5f
commit 04735179f0
1 changed files with 25 additions and 3 deletions

View File

@ -90,6 +90,24 @@ update_status() {
echo "<li><a href=\"$2\">$1</a> <font size=\"-1\">($time seconds)</font></li>" >> $RESULT_FILE
}
place_summary_first() {
testf=$1
sed -n '/^[0-9][0-9]* tests OK\./,$p' < $testf \
| egrep -v '\[[0-9]+ refs\]' > $testf.tmp
echo "" >> $testf.tmp
cat $testf >> $testf.tmp
mv $testf.tmp $testf
}
count_failures () {
testf=$1
n=`grep -ic " failed:" $testf`
if [ $n -eq 1 ] ; then
n=`grep " failed:" $testf | sed -e 's/ .*//'`
fi
echo $n
}
mail_on_failure() {
if [ "$NUM_FAILURES" != "0" ]; then
dest=$FAILURE_MAILTO
@ -185,14 +203,16 @@ if [ $err = 0 -a "$BUILD_DISABLED" != "yes" ]; then
F=make-test.out
start=`current_time`
$PYTHON $REGRTEST_ARGS >& build/$F
NUM_FAILURES=`grep -ic " failed:" build/$F`
NUM_FAILURES=`count_failures build/$F`
place_summary_first build/$F
update_status "Testing basics ($NUM_FAILURES failures)" "$F" $start
mail_on_failure "basics" build/$F
F=make-test-opt.out
start=`current_time`
$PYTHON -O $REGRTEST_ARGS >& build/$F
NUM_FAILURES=`grep -ic " failed:" build/$F`
NUM_FAILURES=`count_failures build/$F`
place_summary_first build/$F
update_status "Testing opt ($NUM_FAILURES failures)" "$F" $start
mail_on_failure "opt" build/$F
@ -204,6 +224,7 @@ if [ $err = 0 -a "$BUILD_DISABLED" != "yes" ]; then
$PYTHON $REGRTEST_ARGS -R 4:3:$REFLOG -u network $LEAKY_SKIPS >& build/$F
LEAK_PAT="($LEAKY_TESTS|sum=0)"
NUM_FAILURES=`egrep -vc "$LEAK_PAT" $REFLOG`
place_summary_first build/$F
update_status "Testing refleaks ($NUM_FAILURES failures)" "$F" $start
mail_on_failure "refleak" $REFLOG "$LEAK_PAT"
@ -213,7 +234,8 @@ if [ $err = 0 -a "$BUILD_DISABLED" != "yes" ]; then
## skip curses when running from cron since there's no terminal
## skip sound since it's not setup on the PSF box (/dev/dsp)
$PYTHON $REGRTEST_ARGS -uall -x test_curses test_linuxaudiodev test_ossaudiodev >& build/$F
NUM_FAILURES=`grep -ic " failed:" build/$F`
NUM_FAILURES=`count_failures build/$F`
place_summary_first build/$F
update_status "Testing all except curses and sound ($NUM_FAILURES failures)" "$F" $start
mail_on_failure "all" build/$F
fi