taskwarrior/src/tests/run_all
Federico Hernandez b31cc639a4 Fixed bug due to incompatible 'date' commands on OS X and Linux
to display runtime of all unit tests
2009-06-23 10:49:55 +02:00

34 lines
564 B
Bash
Executable file

#! /bin/bash
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)
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))
echo -n 'Pass: '
grep ^ok all.log | wc -l
echo -n 'Fail: '
grep ^not all.log | wc -l
echo -n 'Runtime: '
echo $RUNTIME