From: Fabian Fichter Date: Thu, 23 Apr 2020 22:48:10 +0000 (+0200) Subject: Add protocol tests X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=bc6da6f569b5fcaa44b8b2db9dfe6cb29acfe932;p=fairystockfish.git Add protocol tests --- diff --git a/.travis.yml b/.travis.yml index 88943ec..4957eac 100644 --- a/.travis.yml +++ b/.travis.yml @@ -61,6 +61,7 @@ script: # # Check perft and reproducible search + - ../tests/protocol.sh - ../tests/perft.sh - ../tests/reprosearch.sh # diff --git a/tests/protocol.sh b/tests/protocol.sh new file mode 100755 index 0000000..8b54a1c --- /dev/null +++ b/tests/protocol.sh @@ -0,0 +1,50 @@ +#!/bin/bash +# verify protocol implementations + +error() +{ + echo "protocol testing failed on line $1" + exit 1 +} +trap 'error ${LINENO}' ERR + +echo "protocol testing started" + +cat << EOF > uci.exp + set timeout 5 + spawn ./stockfish + send "uci\\n" + expect "default chess" + expect "uciok" + send "usi\\n" + expect "default shogi" + expect "usiok" + send "ucci\\n" + expect "option UCI_Variant" + expect "default xiangqi" + expect "ucciok" + send "quit\\n" + expect eof +EOF + +cat << EOF > xboard.exp + set timeout 5 + spawn ./stockfish + send "xboard\\n" + send "protover 2\\n" + expect "feature done=1" + send "ping\\n" + expect "pong" + send "ping\\n" + expect "pong" + send "quit\\n" + expect eof +EOF + +for exp in uci.exp xboard.exp +do + expect $exp > /dev/null + rm $exp +done + +echo "protocol testing OK"