Adds src/tests/shell/testsuites/punkexe/scriptexec.test (12 tests, all
pass) covering app-punkscript / the script subcommand (G-015): piped
execution and honest exit codes, error->exit 1, exitcode propagation,
stdin result echo, default-env dev alias present without boilerplate,
file-form argv passing, the lib:<name> scriptlib mechanism (subpath,
extensionless, bare-arg reclassification, not-found location listing),
and the tclsh-matching Tk main-loop behaviour (0.4.1): a serviced
after-callback runs and exits, a no-exit GUI script stays alive, an
errored GUI script exits promptly without hanging.
Reuses the shellexit.test built-exe harness pattern (pipe stdin,
half-close for EOF, timeout+force-kill) so runs are hang-proof; Tk cases
gated by an auto-detected punktk constraint (probes whether the kit loads
Tk). Full shell suite: 19 pass / 2 skip (console-only punkgoals) / 0 fail.
lib:/Tk cases resolve committed fixtures under scriptlib/_punktest/ - a
lib:-resolvable fixture cannot live in a tcltest temp dir since resolution
only searches scriptlib locations relative to the exe. The subfolder is
test-owned (README + do-not-edit fixture headers); root AGENTS.md carves
it out as the one agent-manageable exception to scriptlib being
user-only. No project version bump - tests/docs/fixtures only, no shipped
shell behaviour change.
Assisted-by: harness=claude; primary-model=claude-fable-5; api-location=anthropic.com
These scripts are fixtures owned by the punk test suite
(src/tests/shell/testsuites/punkexe/scriptexec.test), not user sample
scripts. They exist so tests can exercise the lib: scriptlib-resolution
mechanism and the script subcommand's Tk main-loop behaviour against
stable, committed scripts rather than user-editable samples.
Do not hand-edit these files: the tests assert on their exact behaviour and
output markers. Changing them will break the suite.
The rest of scriptlib/ is user-only territory; this _punktest/ subfolder
is the exception, owned and maintained by the test suite.
They resolve via <punkexe> script lib:_punktest/<name> (subpath resolution
through punk::path::scriptlib_resolve).
Fixtures:
echo.tcl — emits a marker plus its ::argv0/::argv; used for lib:
resolution, subpath resolution, and file-form argument passing.
tk_countdown.tcl <ms> — Tk window that exits 0 from an after callback;
proves the script subcommand services a registered Tk main loop (the
callback runs only if the event loop is serviced).
tk_noexit.tcl — Tk window with no explicit exit; used to prove a GUI
script stays alive (blocks) under script, as it does under tclsh/wish.
tk_error.tcl — Tk window then an uncaught error; proves an errored GUI
script exits promptly (no hanging window).