]> mj.ucw.cz Git - eval.git/commitdiff
Added incremental evaluator.
authorMartin Mares <mj@ucw.cz>
Thu, 6 Apr 2006 10:51:38 +0000 (10:51 +0000)
committerMartin Mares <mj@ucw.cz>
Thu, 6 Apr 2006 10:51:38 +0000 (10:51 +0000)
bin/mo-ev-inc [new file with mode: 0755]

diff --git a/bin/mo-ev-inc b/bin/mo-ev-inc
new file mode 100755 (executable)
index 0000000..47d7645
--- /dev/null
@@ -0,0 +1,30 @@
+#!/bin/bash
+
+[ -n "$1" ] || { echo "Usage: mo-ev-inc <tasks>" ; exit 1 ; }
+
+for user in `bin/mo-get-users` ; do
+       for task in "$@" ; do
+               echo -n "$user/$task: "
+               if [ -d solutions/$user/$task ] ; then
+                       N=`cd solutions/$user/$task && cat * | md5sum | head -c16` 
+               else
+                       N=none
+               fi
+               if [ -f testing/$user/$task/sum ] ; then
+                       O=`cat testing/$user/$task/sum`
+               else
+                       O=none
+               fi
+               echo -n "($O $N) "
+               if [ $O == $N ] ; then
+                       echo OK
+               elif [ $N == none ] ; then
+                       rm -rf testing/$user/$task
+                       echo DELETED
+               else
+                       echo CHANGED
+                       bin/ev $user $task
+                       echo $N >testing/$user/$task/sum
+               fi
+       done
+done