Portability

- Changed bash-style syntax to sh syntax
- Reverted date printing to using perl as per 0cb71a8 for support on
  Solaris
This commit is contained in:
Owen Clarke
2012-08-22 20:34:01 +10:00
parent 98a5788a40
commit c5de9df963

View File

@@ -1,22 +1,22 @@
#! /bin/sh #! /bin/sh
date > all.log date > all.log
STARTEPOCH=`date +%s` STARTEPOCH=`perl -e 'print time'`
VRAMSTEG=/usr/local/bin/vramsteg VRAMSTEG=`which vramsteg`
BAR=0 BAR=0
if [ -x $VRAMSTEG ]; then if [ -x "$VRAMSTEG" ]; then
BAR=1 BAR=1
COUNT=0 COUNT=0
TOTAL=$(ls *.t | wc -l) TOTAL=`ls *.t | wc -l`
START=$($VRAMSTEG --now) START=`$VRAMSTEG --now`
fi fi
for i in *.t *.t.exe for i in *.t *.t.exe
do do
echo '#' $i >>all.log echo '#' $i >>all.log
if [ $BAR == 1 ]; then if [ $BAR -eq 1 ]; then
$VRAMSTEG --label 'All tests' --min 0 --max $TOTAL --current $COUNT --percentage --start $START --estimate $VRAMSTEG --label 'All tests' --min 0 --max $TOTAL --current $COUNT --percentage --start $START --estimate
COUNT=`expr $COUNT + 1` COUNT=`expr $COUNT + 1`
fi fi
@@ -24,16 +24,16 @@ do
./$i >> all.log 2>&1 ./$i >> all.log 2>&1
done done
if [ $BAR == 1 ]; then if [ $BAR -eq 1 ]; then
$VRAMSTEG --remove $VRAMSTEG --remove
fi fi
date >> all.log date >> all.log
ENDEPOCH=`date +%s` ENDEPOCH=`perl -e 'print time'`
RUNTIME=`expr $ENDEPOCH - $STARTEPOCH` RUNTIME=`expr $ENDEPOCH - $STARTEPOCH`
printf "Pass: %5d\n" $(grep -c ^ok all.log) printf "Pass: %5d\n" `grep -c '^ok' all.log`
printf "Fail: %5d\n" $(grep -c ^not all.log) printf "Fail: %5d\n" `grep -c '^not' all.log`
printf "Skipped: %5d\n" $(grep -c ^skip all.log) printf "Skipped: %5d\n" `grep -c '^skip' all.log`
printf "Runtime: %5d seconds\n" $RUNTIME printf "Runtime: %5d seconds\n" $RUNTIME