summaryrefslogtreecommitdiffstats
path: root/schedsim/shell/run_scenarios
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2011-06-23 20:28:41 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2011-06-23 20:28:41 +0000
commitc552573d4674d7a119eb903942c9bd1f0bb8a402 (patch)
tree75f0ef16b9fc5545075c8670cd921ba78b1d5189 /schedsim/shell/run_scenarios
parent2011-06-20 Joel Sherrill <joel.sherrill@oarcorp.com> (diff)
downloadrtems-schedsim-c552573d4674d7a119eb903942c9bd1f0bb8a402.tar.bz2
2011-06-23 Joel Sherrill <joel.sherrill@oarcorp.com>
* run_scenarios: Improve error checking.
Diffstat (limited to 'schedsim/shell/run_scenarios')
-rwxr-xr-xschedsim/shell/run_scenarios12
1 files changed, 12 insertions, 0 deletions
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$//'`