#! /bin/sh
#
# $Id: run_benchmarks.sh,v 1.5 2000/07/02 13:50:31 yamauchi Exp $
#     Copyright (C) 2000 YAMAUCHI Hitoshi »³Æâ ÀÆ
# run all benchmarks in R^2mark
#
MAKE=make
# ACCURATE=run_accurate
ACCURATE=run_inaccurate

#
# starting confirmation
#
if [ $# -eq 0 ]; then
    echo "This benchmark suite may take a long time to run. Is it OK? (yes/else)"
    read line
    if [ "X"$line != "X""yes" ]; then
	echo "OK!, exit."
	exit 0;
    fi
else
    if [ $1 = "-h" -o $1 = "--help" ] ; then
	echo "Usage: run_benchmarks.sh"
	echo "	if an argument which is not -h or --help is indicated,"
	echo "	this script do not ask any questions."
	echo "		Copyright (C) 2000 YAMAUCHI Hitoshi"
	exit 1;
    fi
fi

#
# Run the all benchmarks
#
for dir in C++ Java
do
    for scene in office soda conf
    do
	if [ ! -f ${dir}/${scene}/proc_r2mark.sh ] ; then
	    (cd ${dir}/${scene}; ln -s ../proc_r2mark.sh .)
	fi
    done
done

${MAKE} copyexec
for acc in test accurate inaccurate
do
    for dir in C++ Java
    do
	for scene in office soda conf
	do
	    (cd ${dir}/${scene}; ./proc_r2mark.sh ${scene} ${acc} )
	done
    done
done
