makefile for benchmarks.
[minix.git] / benchmarks / run
blob1bc2c8c7a5ef95c05a23f3ac68647aee888d40a6
1 #!/bin/sh
3 set -e
5 make
7 benchmarks=`echo *bench*`
9 runbench() {
10 out="Results/$1.`date +%Y%m%d.%H%M%S`"
11 echo "Running $1, saving output to $out."
12 ( cd $1 && sh run.sh 2>&1 ) | tee $out
15 clear
16 n=1
17 for b in $benchmarks
18 do echo "$n. $b"
19 eval "n$n=$b"
20 n=`expr $n + 1`
21 done
22 echo
23 echo -n "Run which benchmark or 'all'? "
24 read bench
25 var=`eval echo "\\$n$bench"`
26 if [ "$bench" = all ]
27 then for b in $benchmarks
28 do runbench $b
29 done
30 else if [ -d "$var" ]
31 then runbench $var
32 else echo "Unknown benchmark."
33 exit 1