summaryrefslogtreecommitdiff
path: root/test/test.sh
diff options
context:
space:
mode:
Diffstat (limited to 'test/test.sh')
-rwxr-xr-xtest/test.sh18
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