From c552573d4674d7a119eb903942c9bd1f0bb8a402 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Thu, 23 Jun 2011 20:28:41 +0000 Subject: 2011-06-23 Joel Sherrill * run_scenarios: Improve error checking. --- schedsim/shell/run_scenarios | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'schedsim/shell/run_scenarios') diff --git a/schedsim/shell/run_scenarios b/schedsim/shell/run_scenarios index 09777f3..0212941 100755 --- a/schedsim/shell/run_scenarios +++ b/schedsim/shell/run_scenarios @@ -3,6 +3,12 @@ # $Id$ # +fatal() +{ + echo "$*" + exit 1 +} + toggle() { case $1 in @@ -50,8 +56,12 @@ done if [ "X${schedsim_dir}" != "X" ] ; then test -d ${schedsim_dir} || fatal ${schedsim_dir} is not readable schedsim_dir=${schedsim_dir}/ +else + fatal "schedsim binary directory must be specified with -d option" fi +test -d scenarios || fatal scenarios directory is not present + if [ ${do_all} = "yes" ]; then SCENARIOS="scenarios/*.scen" else @@ -66,6 +76,8 @@ if [ ${do_four} = "yes" ]; then SCENARIOS="${SCENARIOS} scenarios/cpus4*.scen" fi +test "X${SCENARIOS}" = "X" && fatal "No scenarios specified" + for scenario in `ls -1 ${SCENARIOS}` do base=`echo ${scenario} | sed -s 's/\.scen$//'` -- cgit v1.2.3