taskwarrior/src/tests/run_all
Paul Beckingham 6304ca7c1f Unit Tests - run_all
- Added better formatting of the results.
- Added a count of the skipped tests.
2010-03-01 18:16:29 -05:00

32 lines
645 B
Bash
Executable file

#! /bin/sh
date > all.log
for i in *.t
do
./$i >> all.log 2>&1
done
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