[473574]: testall Maximize Restore History

Download this file

testall    54 lines (38 with data), 1.1 kB

#!/bin/bash

# testall [-3]
#
# Deletes all compiled_krb directories, then runs testall twice.
# 
# exit status > 0 if errors found.

TMP1=/tmp/testall1.$$
TMP2=/tmp/testall2.$$

CMD="${0##*/} $@"

#echo $CMD

echo Removing all compiled_krb directories.
echo

find . -name krb_compiler -prune -o -name compiled_krb -exec rm -rf "{}" +

echo Running all tests with no compiled_krb files:
echo

$CMD -s $TMP1
status1=$?

echo
echo Running all tests with compiled_krb files:
echo

$CMD -s $TMP2 tst txt
status2=$?

results1=(`sed -n '1s/^Files: \([0-9]*\), Tests: \([0-9]*\), Errors: \(.*\)$/\1 \2 \3/p' $TMP1`)
results2=(`sed -n '1s/^Files: \([0-9]*\), Tests: \([0-9]*\), Errors: \(.*\)$/\1 \2 \3/p' $TMP2`)

echo
echo "Compiling compiled_krb:" Files: ${results1[0]}, \
     Tests: ${results1[1]}, \
     Errors: ${results1[2]}
echo "Reusing   compiled_krb:" Files: ${results2[0]}, \
     Tests: ${results2[1]}, \
     Errors: ${results2[2]}
echo

tail -q -n +2 $TMP1 $TMP2 | sort -u

rm -f $TMP1 $TMP2

if [ $status1 -gt 0 -o $status2 -gt 0 ]
then
    exit 1
fi