2 # This is autotest gathering tool, collecting game result info from
3 # all clients and putting it in single place (which is completely
11 # First, gather pairing data:
14 pairing
="${dir%/}"; pairing
="${pairing#c/*/}"
15 datfile
="r/$pairing.dat"
17 if [ ! -s "$datfile" ]; then
18 # Common datfile header, required for twogtp -analyze
21 echo -e "#GAME\tRES_B\tRES_W\tRES_R\tALT\tDUP\tLEN\tTIME_B\tTIME_W\tCPU_B\tCPU_W\tERR\tERR_MSG"
25 lastgame
="$(tail -n 1 "$datfile")"
26 num
="$((${lastgame%% *} + 1))"
28 # We cannot simply concatenate all the datfiles because
29 # twogtp -analyze is pedantic about the games numbering;
30 # we need to renumber the games to a single sequence.
31 while read orignum line
; do
34 done <"$dir/game.dat" >>"$datfile"
38 # Next, fill per-pairing metadata:
40 for datfile
in r
/*.dat
; do
41 pairing
="${datfile%.dat}"; pairing
="${pairing#r/}"
43 # Look at last change in pairing:
44 stat
-c %Z
"$(ls --sort=time c/*/"$pairing"/* | head -n 1)" >"r/$pairing.beacon"
46 # Check pairing for errors:
47 tail -n +3 "$datfile" | cut
-f 12 |
{ grep -c -vF 0 >"r/$pairing.error" ||
:; }