X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=tests%2Fsignature.sh;fp=tests%2Fsignature.sh;h=2eb52c89be24c5a3e15e27c6faf996e5881b4d93;hp=0000000000000000000000000000000000000000;hb=ba15781be8f80746b6daed6588191297f38737fa;hpb=d39ffbeea6ad54c90123a352d50b65c5bda1561b diff --git a/tests/signature.sh b/tests/signature.sh new file mode 100755 index 00000000..2eb52c89 --- /dev/null +++ b/tests/signature.sh @@ -0,0 +1,26 @@ +#!/bin/bash +# obtain and optionally verify Bench / signature +# if no reference is given, the output is deliberately limited to just the signature + +error() +{ + echo "running bench for signature failed on line $1" + exit 1 +} +trap 'error ${LINENO}' ERR + +# obtain + +signature=`./stockfish bench 2>&1 | grep "Nodes searched : " | awk '{print $4}'` + +if [ $# -gt 0 ]; then + # compare to given reference + if [ "$1" != "$signature" ]; then + echo "signature mismatch: reference $1 obtained $signature" + else + echo "signature OK: $signature" + fi +else + # just report signature + echo $signature +fi