2 # This is autotest display tool, showing gathered information in
3 # a hopefully meaningful way.
6 [ -n "$mask" ] || mask
="*"
10 echo "Did you run autotest-gather?" >&2
17 pairing
() { pknown
="$pknown$(pairid "$@
") "; }
20 color_stale
="\033[33m"
26 # See README for explanation of flags.
28 if [ -s "r/$pairing.error" ] && [ "$(cat "r
/$pairing.error
")" -gt 0 ]; then
31 known
=1; [ "${pknown#* $pairing *}" != "$pknown" ] || known
=0
32 active
=1; ([ -s "r/$pairing.beacon" ] && [ "$(cat "r
/$pairing.beacon
")" -ge "$(($(date +%s) - 60*60*2))" ]) || active
=0
33 case $error$known$active in
34 001) status
="${color_stale}?";;
35 000) status
="${color_stale}/";;
36 011) status
="${color_fresh}.";;
37 010) status
="${color_fresh}${color_bad}!";;
38 1*0) status
="${color_bad}x";;
39 1*1) status
="${color_fresh}${color_bad}X";;
43 rm -f r
/*.summary.dat r
/*.html
45 echo -e "S GAMES\tWINRATE\tS.D.\tPAIRING"
46 for pairing
in $
((echo "$pknown" |
tr ' ' '\n'; ls r
/*.dat |
sed 's#^r/##; s#\.dat$##') |
sort |
uniq); do
47 [ ! -s "r/$pairing.dat" ] ||
$twogtp_path -analyze "r/$pairing.dat"
48 pairing_status
"$pairing" # sets status
49 if [ -s "r/$pairing.summary.dat" ]; then
50 echo -e "$status $(cat "r
/${pairing}".summary.dat | cut -f 1,7,8 | tail -n +2)\t$pairing$color_stop"
52 echo -e "$status 0\t-\t-\t$pairing$color_stop"