#!/usr/bin/env bash # ========================================================================= # #140 -- reach the teardown the way the FIELD does: a MISSION that ENDS. # # Three earlier attempts never exercised BTGlassPanels_Destroy at all: # bt_kill_ours uses `taskkill /F` (no dtors), and a graceful WM_CLOSE on a # solo -egg run did not reach it either. The path that matters is the one # testers hit constantly -- the controls manager is destroyed and rebuilt at # every ROUND boundary, which is exactly what the relay drives in MP. # # Panels ON for both nodes; the relay starts a round and the round ends. # The receipt to read is `[glasswin] destroy entry #N windows=M`: # #1 windows=7 then #2 windows=0 -> the double-destroy, confirmed # and then exactly ONE "saved N window position(s)" line, with the cfg intact. # ========================================================================= set -x . /c/git/bt411/scratchpad/night6/bench_common.sh cd /c/git/bt411/content || exit 1 taskkill //F //IM btl4.exe > /dev/null 2>&1 sleep 2 rm -f glass_layout.cfg lr_a.log lr_b.log lr_relay.log bt_expert_egg MP.EGG LR.EGG sed -i "s/^map=.*/map=grass/; s/^time=.*/time=day/; s/^vehicle=.*/vehicle=madcat/" LR.EGG ( export BT_GLASS_PANELS=1 BT_GLASS_LAYOUT=save BT_MP_LOG=1 bt_launch lr_b.log LR.EGG 0x0C -net 1601 ) sleep 2 ( export BT_GLASS_PANELS=1 BT_GLASS_LAYOUT=save BT_MP_LOG=1 bt_launch lr_a.log LR.EGG 0x03 -net 1501 ) sleep 5 python ../tools/btconsole.py LR.EGG 127.0.0.1:1501 127.0.0.1:1601 > lr_relay.log 2>&1 & RELAY=$! sleep 180 kill $RELAY 2>/dev/null sleep 5 bt_kill_ours sleep 2 taskkill //F //IM btl4.exe > /dev/null 2>&1 sleep 3 echo "=================== #140 TEARDOWN RECEIPTS ===================" for n in a b; do echo "--- node $n: destroy entries ---" grep -a "destroy entry" lr_${n}.log echo "--- node $n: SaveLayout receipts ---" grep -a "window position" lr_${n}.log done echo echo "--- glass_layout.cfg entries ---" grep -aE "^[^#]+=" glass_layout.cfg 2>/dev/null || echo "(no file)" echo -n "entry count: "; grep -acE "^[^#]+=" glass_layout.cfg 2>/dev/null