[rtems-schedsim commit] make check now works and reports pass/fail

Joel Sherrill joel at rtems.org
Mon May 26 22:18:28 UTC 2014


Module:    rtems-schedsim
Branch:    master
Commit:    d36a128be4709a3ff6099b9e23f38504f63aa954
Changeset: http://git.rtems.org/rtems-schedsim/commit/?id=d36a128be4709a3ff6099b9e23f38504f63aa954

Author:    Joel Sherrill <joel.sherrill at oarcorp.com>
Date:      Mon May 26 17:24:17 2014 -0500

make check now works and reports pass/fail

---

 schedsim/shell/run_scenarios                       |   36 +++++++++++++++++---
 schedsim/shell/schedsim_priority/Makefile.am       |    2 +-
 schedsim/shell/schedsim_smppriority/Makefile.am    |    7 ++--
 .../schedsim_smppriority_affinity/Makefile.am      |    7 ++--
 schedsim/shell/schedsim_smpsimple/Makefile.am      |    7 ++--
 5 files changed, 44 insertions(+), 15 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
diff --git a/schedsim/shell/schedsim_priority/Makefile.am b/schedsim/shell/schedsim_priority/Makefile.am
index 7f2584c..6f8806c 100644
--- a/schedsim/shell/schedsim_priority/Makefile.am
+++ b/schedsim/shell/schedsim_priority/Makefile.am
@@ -40,7 +40,7 @@ schedsim_priority_LDADD += ../shared/libschedsim.a
 ## schedsim_priority_LDADD +=-Wl,--end-group
 
 check-local:
-	@echo Running tests
+	@echo Running tests from Uniprocessor Deterministic Priority
 	$(srcdir)/../run_scenarios \
 	    -s $(builddir)/schedsim_priority \
 	    -S $(srcdir) \
diff --git a/schedsim/shell/schedsim_smppriority/Makefile.am b/schedsim/shell/schedsim_smppriority/Makefile.am
index ddc4648..81a6981 100644
--- a/schedsim/shell/schedsim_smppriority/Makefile.am
+++ b/schedsim/shell/schedsim_smppriority/Makefile.am
@@ -40,16 +40,17 @@ schedsim_smppriority_LDADD += ../../rtems/librtems.a
 schedsim_smppriority_LDADD += ../shared/libschedsim.a
 ## schedsim_smppriority_LDADD +=-Wl,--end-group
 
+## Skip schedsim_priority/.../script0[13] since they requires task mode
 check-local:
 	@echo Running tests from SMP Simple
 	$(srcdir)/../run_scenarios \
 	    -s $(builddir)/schedsim_smppriority \
-	    -S $(srcdir)../schedsim_smpsimple \
+	    -S $(srcdir)/../schedsim_smpsimple \
 	    -A
 	@echo Running tests from Priority
 	$(srcdir)/../run_scenarios \
 	    -s $(builddir)/schedsim_smppriority \
-	    -S $(srcdir)../schedsim_priority \
-	    -A
+	    -S $(srcdir)/../schedsim_priority \
+	    script02.scen script04.scen script05.scen script06.scen
 
 include $(top_srcdir)/../automake/host.am
diff --git a/schedsim/shell/schedsim_smppriority_affinity/Makefile.am b/schedsim/shell/schedsim_smppriority_affinity/Makefile.am
index 844a40a..a6409bf 100644
--- a/schedsim/shell/schedsim_smppriority_affinity/Makefile.am
+++ b/schedsim/shell/schedsim_smppriority_affinity/Makefile.am
@@ -51,10 +51,11 @@ check-local:
 	    -s $(builddir)/schedsim_smppriority_affinity \
 	    -S $(srcdir)/../schedsim_smpsimple \
 	    -A
-	@echo Running select tests from Priority
+	@echo Running tests from Uniprocessor Deterministic Priority
 	$(srcdir)/../run_scenarios \
 	    -s $(builddir)/schedsim_smppriority_affinity \
-	    -S $(srcdir)/../schedsim_smpsimple \
-	    -A
+	    -S $(srcdir)/../schedsim_priority \
+	    script02.scen script04.scen script05.scen script06.scen
+
 
 include $(top_srcdir)/../automake/host.am
diff --git a/schedsim/shell/schedsim_smpsimple/Makefile.am b/schedsim/shell/schedsim_smpsimple/Makefile.am
index 2d534df..48dc9eb 100644
--- a/schedsim/shell/schedsim_smpsimple/Makefile.am
+++ b/schedsim/shell/schedsim_smpsimple/Makefile.am
@@ -39,16 +39,17 @@ schedsim_smpsimple_LDADD += ../../rtems/librtems.a
 schedsim_smpsimple_LDADD += ../shared/libschedsim.a
 ## schedsim_smpsimple_LDADD +=-Wl,--end-group
 
+## Skip schedsim_priority/.../script0[13] since they requires task mode
 check-local:
 	@echo Running tests from SMP Simple Priority
 	$(srcdir)/../run_scenarios \
 	    -s $(builddir)/schedsim_smpsimple \
 	    -S $(srcdir) \
 	    -A
-	@echo Running tests from Priority
+	@echo Running tests from Uniprocessor Deterministic Priority
 	$(srcdir)/../run_scenarios \
 	    -s $(builddir)/schedsim_smpsimple \
-	    -S $(srcdir)../schedsim_priority \
-	    -A
+	    -S $(srcdir)/../schedsim_priority \
+	    script02.scen script04.scen script05.scen script06.scen
 
 include $(top_srcdir)/../automake/host.am




More information about the vc mailing list