mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Moved src/tests to test (cmake preperations)
This commit is contained in:
parent
02dcdf83b5
commit
17ef077e27
210 changed files with 0 additions and 0 deletions
60
test/run_all
Executable file
60
test/run_all
Executable file
|
@ -0,0 +1,60 @@
|
|||
#! /bin/bash
|
||||
|
||||
date > all.log
|
||||
|
||||
MODE=quick
|
||||
if [ "x$1" == 'xslow' ]; then
|
||||
echo 'Including benchmarks'
|
||||
MODE=slow
|
||||
else
|
||||
echo 'Skipping benchmarks'
|
||||
fi
|
||||
|
||||
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
|
||||
if [ $BAR == 1 ]; then
|
||||
$VRAMSTEG --label 'All tests' --min 0 --max $TOTAL --current $COUNT --percentage --start $START --estimate
|
||||
COUNT=$[COUNT + 1]
|
||||
fi
|
||||
|
||||
if [[ $MODE == 'slow' || $i != 'benchmark.t' ]]; then
|
||||
./$i >> all.log 2>&1
|
||||
fi
|
||||
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
|
Loading…
Add table
Add a link
Reference in a new issue