Moggy: Remove old, dusty and ineffective assess_local
[pachi.git] / t-play / autotest / autotest-show
blob02805fa1c2ff9e6fd38dee7026f6c44e75d2f7ce
1 #!/bin/sh
2 # This is autotest display tool, showing gathered information in
3 # a hopefully meaningful way.
5 mask="$1"
6 [ -n "$mask" ] || mask="*"
7 . ./autotest-lib
9 if [ ! -d "r" ]; then
10 echo "Did you run autotest-gather?" >&2
11 exit 1
14 # Load rc quickly:
15 player() { :; }
16 pknown=" "
17 pairing() { pknown="$pknown$(pairid "$@") "; }
18 . rc
20 pairing_status() {
21 # See README for explanation of flags.
22 if [ -s "r/$pairing.error" ] && [ "$(cat "r/$pairing.error")" -gt 0 ]; then
23 status="x"
24 return
26 known=1; [ "${pknown#* $pairing *}" != "$pknown" ] || known=0
27 active=1; ([ -s "r/$pairing.beacon" ] && [ "$(cat "r/$pairing.beacon")" -ge "$(($(date +%s) - 60*60*2))" ]) || active=0
28 case $known$active in
29 01) status="?";;
30 00) status="/";;
31 11) status=".";;
32 *) status="!";;
33 esac
36 rm -f r/*.summary.dat r/*.html
38 echo -e "S GAMES\tWINRATE\tS.D.\tPAIRING"
39 for pairing in $((echo "$pknown" | tr ' ' '\n'; ls r/*.dat | sed 's#^r/##; s#\.dat$##') | sort | uniq); do
40 [ ! -s "r/$pairing.dat" ] || $twogtp_path -analyze "r/$pairing.dat"
41 pairing_status "$pairing" # sets status
42 if [ -s "r/$pairing.summary.dat" ]; then
43 echo -e "$status $(cat "r/${pairing}".summary.dat | cut -f 1,7,8 | tail -n +2)\t$pairing"
44 else
45 echo -e "$status 0\t-\t-\t$pairing"
47 done