tools: let the submenu sweep's self-test be checked without starting a run
Verifying it previously meant launching the script, which then waits ~150 s for a main menu and opens x11grab captures -- so the question "did the self-test pass?" could not be answered without disturbing whatever else was using the display. That is how a check-the-tool step turned into competing load during a measurement once already. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Wuu56cE8vJGTBtn1ppsk8v
This commit is contained in:
@@ -144,6 +144,12 @@ def _self_test():
|
||||
|
||||
print("── decision-rule self-test ──", flush=True)
|
||||
_self_test()
|
||||
# Verifiable WITHOUT starting a run. Without this the only way to check the
|
||||
# self-test was to launch the script, which then proceeds to wait ~150 s for a
|
||||
# main menu and opens x11grab captures -- so "did my self-test pass?" could not be
|
||||
# answered without disturbing whatever else was using the display.
|
||||
if "--selftest-only" in sys.argv:
|
||||
sys.exit(0)
|
||||
|
||||
MAIN = wait_until(lambda a: main_menu_item(ring_row(img(a))) is not None
|
||||
and 250 <= glyph(a) <= 420, "the main menu", 150)
|
||||
|
||||
Reference in New Issue
Block a user