test-game.sh: Support ./pachi customization using $PACHIARGS
[pachi.git] / t-regress / test-game.sh
blobf06aad99f6e85984574e2ff8b03f528bf0012b8d
1 #!/bin/sh
3 # test-game: Run testcases within a single game
5 # Usage: test-game.sh FILENAME
7 # Examine a game record and run testcases for all moves described
8 # in the "game comment".
10 # Pass any extra Pachi parameters in PACHIARGS. E.g.
11 # PACHIARGS='-t =100000 -d 2 threads=2' testgame.sh ...
13 sgf="$1"
15 sed -ne '/GC\[.*\]/{s/.*GC\[\([^]]*\)\].*/\1/p; q;}; /GC\[/,/\]/{ s/.*GC\[//; s/\].*//; p; }' <"$sgf" |
16 while read moven cases desc; do
17 echo "Examining move $moven"; sleep 1
18 tools/sgf2gtp.pl -g -n $((moven-1)) <"$sgf" | ./pachi -t =20000 $PACHIARGS
19 echo "Testcases: $cases ($desc)"
20 echo "Confirm and press enter..."; read xx </dev/tty
21 done