diff options
author | Camil Staps | 2017-10-02 14:52:42 +0200 |
---|---|---|
committer | Camil Staps | 2017-10-02 14:52:42 +0200 |
commit | 39ba6abf1e941c8f1fef0e83f449c5cf3ed7cf69 (patch) | |
tree | 4ceb1326124ef6b10f904d5f79959013722ca310 /test/test.sh | |
parent | Textual refinements (diff) | |
parent | Write section on Manual and Automated testing (diff) |
Merge branch 'master' of gitlab.science.ru.nl:eveen/Testing-Techniques
Diffstat (limited to 'test/test.sh')
-rwxr-xr-x | test/test.sh | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/test.sh b/test/test.sh new file mode 100755 index 0000000..17728aa --- /dev/null +++ b/test/test.sh @@ -0,0 +1,18 @@ +#!/bin/bash +RED='\033[0;31m' +GREEN='\033[0;32m' +RESET='\033[0;30m' + +for f in database/*.in; +do + output=$(diff "${f/in/out}" <(../src/runchess < "$f")) + testname=$(head -1 $f | cut -d \" -f 2) + if [ "$output" = "" ] + then + echo -e "${GREEN}Test: \"$testname\" passed${RESET}" + else + echo -e "${RED}Test: \"$testname\" failed${RESET}" + diff --suppress-common-lines -y -W 50 "${f/in/out}" <(../src/runchess < "$f") + fi + echo "############################################" +done |