Created
December 22, 2016 14:33
-
-
Save onlined/736fcb81fa9b31b5ba29850bf4459f27 to your computer and use it in GitHub Desktop.
Tester for CENG315 Take Home 1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Put Makefile, inputs and this script in the same directory. | |
files2=({x..z}{1,2}) | |
files3=({a..f}{1,2}) | |
make &>/dev/null | |
ok=true | |
for files in {files2[@],files3[@]}; do | |
for i in ${!files}; do | |
for j in ${!files}; do | |
if [[ $i > $j || $i == $j ]]; then | |
continue; | |
fi | |
if [[ ${i:0:1} == ${j:0:1} ]]; then | |
expected="equal" | |
else | |
expected="notequal" | |
fi | |
result=$(./runHK ${i}.txt ${j}.txt) | |
if [[ $result != $expected ]]; then | |
ok=false | |
echo "$i vs $j:" | |
echo "expected: $expected" | |
echo "your result: $result" | |
echo | |
fi | |
done | |
done | |
done | |
if $ok; then | |
echo "All tests are OK" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment