diff options
author | Haidong Ji | 2022-04-15 15:51:30 -0500 |
---|---|---|
committer | Haidong Ji | 2022-04-15 15:51:30 -0500 |
commit | 442a49ad5a48d417345959b903ae6a6d32d55759 (patch) | |
tree | c7127bb497e5e439018b1915e0136eec2c9cb124 /26_tests_matrix_input/run_all.sh |
Excellent fundamentals and displine training, many tools and techniques
exercises: gdb, emacs, valgrind, git
Diffstat (limited to '26_tests_matrix_input/run_all.sh')
-rwxr-xr-x | 26_tests_matrix_input/run_all.sh | 30 |
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 |