mirror of
https://github.com/GothenburgBitFactory/taskshell.git
synced 2025-08-25 03:07:23 +02:00
Unit Tests
- Set up initial test directory.
This commit is contained in:
parent
dd07ee6ae0
commit
dacd68b236
9 changed files with 890 additions and 0 deletions
65
test/run_all.in
Executable file
65
test/run_all.in
Executable file
|
@ -0,0 +1,65 @@
|
|||
#! /bin/sh
|
||||
|
||||
rc=0
|
||||
if [ x"$1" = x"--verbose" ];
|
||||
then
|
||||
for i in ${TESTBLOB}
|
||||
do
|
||||
echo '#' $i
|
||||
$i > test.log 2>&1
|
||||
while read LINE
|
||||
do
|
||||
echo "$LINE"
|
||||
done < test.log
|
||||
if [ $? -ne 0 ]; then
|
||||
rc=1
|
||||
fi
|
||||
rm test.log
|
||||
done
|
||||
exit $rc
|
||||
else
|
||||
date > all.log
|
||||
|
||||
# Perl is used here to get the time in seconds
|
||||
# because 'date +%s' isn't supported on Solaris.
|
||||
STARTEPOCH=`perl -e 'print time'`
|
||||
|
||||
VRAMSTEG=`which vramsteg`
|
||||
BAR=0
|
||||
if [ -x "$VRAMSTEG" ]; then
|
||||
BAR=1
|
||||
COUNT=0
|
||||
TOTAL=`ls ${TESTBLOB} | wc -l`
|
||||
START=`$VRAMSTEG --now`
|
||||
fi
|
||||
|
||||
for i in ${TESTBLOB}
|
||||
do
|
||||
echo '#' $i >>all.log
|
||||
|
||||
if [ $BAR -eq 1 ]; then
|
||||
$VRAMSTEG --label 'All tests' --min 0 --max $TOTAL --current $COUNT --percentage --start $START --estimate
|
||||
COUNT=`expr $COUNT + 1`
|
||||
fi
|
||||
|
||||
$i >> all.log 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
rc=1
|
||||
fi
|
||||
done
|
||||
|
||||
if [ $BAR -eq 1 ]; then
|
||||
$VRAMSTEG --remove
|
||||
fi
|
||||
|
||||
date >> all.log
|
||||
|
||||
ENDEPOCH=`perl -e 'print time'`
|
||||
RUNTIME=`expr $ENDEPOCH - $STARTEPOCH`
|
||||
|
||||
printf "Pass: %5d\n" `grep -c '^ok' all.log`
|
||||
printf "Fail: %5d\n" `grep -c '^not' all.log`
|
||||
printf "Skipped: %5d\n" `grep -c '^skip' all.log`
|
||||
printf "Runtime: %5d seconds\n" $RUNTIME
|
||||
exit $rc
|
||||
fi
|
Loading…
Add table
Add a link
Reference in a new issue