summaryrefslogtreecommitdiffstats
path: root/schedsim/shell/run_scenarios
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@oarcorp.com>2014-05-26 17:24:17 -0500
committerJoel Sherrill <joel.sherrill@oarcorp.com>2014-05-26 17:24:17 -0500
commitd36a128be4709a3ff6099b9e23f38504f63aa954 (patch)
tree65c4588b0d22d3789f1ca326cd12a8aa0bef2952 /schedsim/shell/run_scenarios
parentAdd initial support for make check (diff)
downloadrtems-schedsim-d36a128be4709a3ff6099b9e23f38504f63aa954.tar.bz2
make check now works and reports pass/fail
Diffstat (limited to 'schedsim/shell/run_scenarios')
-rwxr-xr-xschedsim/shell/run_scenarios36
1 files changed, 31 insertions, 5 deletions
diff --git a/schedsim/shell/run_scenarios b/schedsim/shell/run_scenarios
index 86f0f8d..1b59fcd 100755
--- a/schedsim/shell/run_scenarios
+++ b/schedsim/shell/run_scenarios
@@ -56,6 +56,11 @@ do
esac
done
+shiftcount=`expr $OPTIND - 1`
+shift $shiftcount
+
+args=$*
+
if [ "X${schedsim}" != "X" ] ; then
type ${schedsim} >/dev/null 2>&1 || fatal ${schedsim} not found
else
@@ -69,7 +74,10 @@ test -d ${scen}|| \
if [ ${do_all} = "yes" ]; then
SCENARIOS="${scen}/*.scen"
else
- SCENARIOS=
+ for i in $*
+ do
+ SCENARIOS="${SCENARIOS} ${scen}/${i}"
+ done
fi
if [ ${do_one} = "yes" ]; then
@@ -82,25 +90,43 @@ fi
test "X${SCENARIOS}" = "X" && fatal "No scenarios specified"
-for scenario in `ls -1 ${SCENARIOS}`
+for scenario in ${SCENARIOS}
+do
+ test -r ${scenario} || fatal "Scenario ${scenario} not found!"
+done
+
+scenarios=0
+passed=0
+failed=0
+for scenario in ${SCENARIOS}
do
base=`echo ${scenario} | sed -s 's/\.scen$//'`
expected=${base}.expected
output=${base}.output
vecho Running ${scenario}
+ run=`expr ${run} + 1`
${schedsim} $scenario >${output}
- if [ -r ${expected} ] ; then
+ if [ $? -ne 0 ] ; then
+ failed=`expr ${failed} + 1`
+ echo "FAIL - ${scenario}"
+ elif [ -r ${expected} ] ; then
diff ${output} ${expected} >/dev/null
if [ $? -ne 0 ] ; then
+ failed=`expr ${failed} + 1`
echo "FAIL - ${scenario}"
echo " diff ${output} ${expected} "
else
+ passed=`expr ${passed} + 1`
echo "PASS - ${scenario}"
fi
else
- echo "UNKNOWN - ${scenario}"
- echo " cp ${output} ${expected} "
+ echo "UNKNOWN - ${scenario}"
fi
done
+echo "=== Test report for `basename ${schedsim}`"
+echo "Run: " ${run}
+echo "Passed: " ${passed}
+echo "Failed: " ${failed}
+exit 0