mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Fixed bug due to incompatible 'date' commands on OS X and Linux
to display runtime of all unit tests
This commit is contained in:
parent
f7c91d6db7
commit
b31cc639a4
1 changed files with 14 additions and 4 deletions
|
@ -10,14 +10,24 @@ done
|
|||
date >> all.log
|
||||
|
||||
START=`head -1 all.log`
|
||||
STARTEPOCH=`date "+%s" -d "${START}"`
|
||||
END=`tail -1 all.log`
|
||||
ENDEPOCH=`date "+%s" -d "${END}"`
|
||||
RUNTIME=$(($ENDEPOCH-$STARTEPOCH))
|
||||
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: '
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue