taskwarrior/test/run_all
Paul Beckingham 1b55a48757 Unit Tests
- Eliminated obsolete benchmark.t.
- Removed the 'quick' mode logic to skip benchmarks in run_all.
- Restored bug.480.t tests that hung earlier.
2011-08-21 01:09:32 -04:00

52 lines
1 KiB
Bash
Executable file

#! /bin/bash
date > all.log
VRAMSTEG=/usr/local/bin/vramsteg
BAR=0
if [ -x $VRAMSTEG ]; then
BAR=1
COUNT=0
TOTAL=$(ls *.t | wc -l)
START=$($VRAMSTEG --now)
fi
for i in *.t
do
echo '#' $i >>all.log
if [ $BAR == 1 ]; then
$VRAMSTEG --label 'All tests' --min 0 --max $TOTAL --current $COUNT --percentage --start $START --estimate
COUNT=$[COUNT + 1]
fi
./$i >> all.log 2>&1
done
if [ $BAR == 1 ]; then
$VRAMSTEG --remove
fi
date >> all.log
START=`head -1 all.log`
END=`tail -1 all.log`
OS=`uname`
case $OS in
Darwin | FreeBSD)
STARTEPOCH=`date -j -f "%a %b %d %T %Z %Y" "${START}" "+%s"`
ENDEPOCH=`date -j -f "%a %b %d %T %Z %Y" "${END}" "+%s"`
;;
Linux)
STARTEPOCH=`date "+%s" -d "${START}"`
ENDEPOCH=`date "+%s" -d "${END}"`
;;
esac
RUNTIME=$(($ENDEPOCH - $STARTEPOCH))
printf "Pass: %5d\n" $(grep ^ok all.log | wc -l)
printf "Fail: %5d\n" $(grep ^not all.log | wc -l)
printf "Skipped: %5d\n" $(grep ^skip all.log | wc -l)
printf "Runtime: %5d\n" $RUNTIME