summaryrefslogtreecommitdiff
path: root/26_tests_matrix_input/run_all.sh
diff options
context:
space:
mode:
Diffstat (limited to '26_tests_matrix_input/run_all.sh')
-rwxr-xr-x26_tests_matrix_input/run_all.sh30
1 files changed, 30 insertions, 0 deletions
diff --git a/26_tests_matrix_input/run_all.sh b/26_tests_matrix_input/run_all.sh
new file mode 100755
index 0000000..f13fdf0
--- /dev/null
+++ b/26_tests_matrix_input/run_all.sh
@@ -0,0 +1,30 @@
+#!/bin/bash
+run_test() {
+ prog="$1"
+ testfile="$2"
+ IFS=$'\n'
+ for line in `cat $testfile | sed 's/^$/ /'`
+ do
+ IFS=" " correct=`/usr/local/l2p/rot_matrix/rotateMatrix $line 2>&1`
+ IFS=" " broken=`$prog $line 2>&1`
+ if [ "$broken" != "$correct" ]
+ then
+ return 0
+ fi
+ done
+ return 1
+}
+
+for i in /usr/local/l2p/rot_matrix/rotateMatrix*
+do
+ if [ "$i" != "/usr/local/l2p/rot_matrix/rotateMatrix" ]
+ then
+ echo "Checking `basename $i`"
+ run_test $i tests.txt
+ x="$?"
+ if [ "$x" != "0" ]
+ then
+ echo "***Your tests failed to show that `basename $i` was broken!"
+ fi
+ fi
+done