summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--schedsim/shell/ChangeLog4
-rwxr-xr-xschedsim/shell/run_scenarios12
2 files changed, 16 insertions, 0 deletions
diff --git a/schedsim/shell/ChangeLog b/schedsim/shell/ChangeLog
index 6ce9f31..365eaf6 100644
--- a/schedsim/shell/ChangeLog
+++ b/schedsim/shell/ChangeLog
@@ -1,3 +1,7 @@
+2011-06-23 Joel Sherrill <joel.sherrill@oarcorp.com>
+
+ * run_scenarios: Improve error checking.
+
2011-05-17 Joel Sherrill <joel.sherrill@oarcorp.com>
* Makefile.am: Merge and update code. Simulators for Deterministic
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$//'`