2010-01-21 17:53:42 +01:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
2010-02-03 17:49:15 +01:00
|
|
|
make
|
|
|
|
|
2010-02-04 18:52:38 +01:00
|
|
|
BENCHDIR=/usr/local/benchmarks
|
|
|
|
|
|
|
|
basebenchmarks=`echo *bench*`
|
2010-02-04 19:15:10 +01:00
|
|
|
|
|
|
|
if [ -d $BENCHDIR ]
|
|
|
|
then packagebenchmarks=`(cd $BENCHDIR && echo *bench*)`
|
|
|
|
fi
|
2010-01-21 17:53:42 +01:00
|
|
|
|
|
|
|
runbench() {
|
2010-02-04 18:52:38 +01:00
|
|
|
bench=$1
|
|
|
|
out="Results/$bench.`date +%Y%m%d.%H%M%S`"
|
|
|
|
if [ -d $bench ]
|
|
|
|
then dir=$bench
|
|
|
|
fi
|
|
|
|
if [ -d $BENCHDIR/$bench ]
|
|
|
|
then dir=$BENCHDIR/$bench
|
|
|
|
fi
|
|
|
|
clear
|
|
|
|
echo "Running $dir."
|
|
|
|
echo "Saving output to $out."
|
|
|
|
echo ""
|
|
|
|
( cd $dir && sh run.sh 2>&1 ) | tee $out
|
2010-01-21 17:53:42 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
clear
|
|
|
|
n=1
|
2010-02-04 18:52:38 +01:00
|
|
|
for b in $basebenchmarks $packagebenchmarks
|
2010-01-21 17:53:42 +01:00
|
|
|
do echo "$n. $b"
|
|
|
|
eval "n$n=$b"
|
|
|
|
n=`expr $n + 1`
|
|
|
|
done
|
|
|
|
echo
|
|
|
|
echo -n "Run which benchmark or 'all'? "
|
|
|
|
read bench
|
2010-02-04 18:52:38 +01:00
|
|
|
eval var=\$n$bench
|
2010-01-21 17:53:42 +01:00
|
|
|
if [ "$bench" = all ]
|
2010-02-04 18:52:38 +01:00
|
|
|
then for b in $basebenchmarks $packagebenchmarks
|
2010-01-21 17:53:42 +01:00
|
|
|
do runbench $b
|
|
|
|
done
|
2010-02-04 18:52:38 +01:00
|
|
|
else if [ -d "$var" -o -d "$BENCHDIR/$var" ]
|
2010-01-21 17:53:42 +01:00
|
|
|
then runbench $var
|
2010-02-04 18:52:38 +01:00
|
|
|
else echo "Unknown benchmark $var."
|
2010-01-21 17:53:42 +01:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
fi
|