Browse Source

runtests: 8.6 -jobs children get the punk::lib compat guard (lpop)

Multi-process children ran without the guarded punk::lib 0.5.1- require,
so under a native 8.6 runner every suite whose module parses via
punk::args::parse died with 'invalid command name "lpop"' - the
lean-children cleanup (7e9eced5) had removed the shellrun preload that
previously pulled punk::lib into children, and the 8.6-support guards
added two days later (1fbee821) covered only the toplevel and singleproc
testinterp. child_test_runner.tcl now mirrors the guard as the third
boot level (a builtin-parity shim, not a lean-children violation -
8.7+/9 children have the same commands as builtins). Verified: zip
subtree 8.6 -jobs 4 was 14/14 fail + 2 file-load errors, now parity
with singleproc (51 pass / 2 skip); args subtree 8.6 -jobs 8 411/411;
9.0 leg unchanged. AGENTS.md boot-level note updated.

Assisted-by: harness=claude; primary-model=claude-fable-5; api-location=anthropic.com
master
Julian Noble 1 day ago
parent
commit
bd9c0feade
  1. 2
      src/tests/AGENTS.md
  2. 12
      src/tests/testsupport/child_test_runner.tcl

2
src/tests/AGENTS.md

@ -42,7 +42,7 @@ Top-level test harness and source-tree tests for ShellSpy/Punk. Tests here exerc
## Work Guidance
- Select an appropriate interpreter, such as `tclsh`, `tclsh90`, or a built Punk executable such as `punk902z`.
- Native Tcl 8.6 tclsh is a supported runner interpreter (2026-07-21): `runtests.tcl` loads punk::lib's validated forward-compat command family (lpop etc - builtin parity pinned by `modules/punk/lib/testsuites/lib/compat.test`) at both boot levels (toplevel and testinterp) when the builtins are absent. The guards are no-ops on Tcl 8.7+/9, preserving the G-093 fast two-stage `-discover-only` boot.
- Native Tcl 8.6 tclsh is a supported runner interpreter (2026-07-21): `runtests.tcl` loads punk::lib's validated forward-compat command family (lpop etc - builtin parity pinned by `modules/punk/lib/testsuites/lib/compat.test`) at all three boot levels (toplevel, singleproc testinterp, and the multi-process child bootstrap `testsupport/child_test_runner.tcl` - the child guard added 2026-08-09 after 8.6 `-jobs` runs failed en-masse with `invalid command name "lpop"`; the 2026-07-19 lean-children cleanup had removed the shellrun preload that previously pulled punk::lib into children) when the builtins are absent. The guards are no-ops on Tcl 8.7+/9, preserving the G-093 fast two-stage `-discover-only` boot.
- Kit-hosted runner hardening (2026-07-21): the runner's own package requires carry minimum-version floors (punk::args in `runtests.tcl`, punk::path in `testsupport/discovery.tcl`, punk::lib in the 8.6 guards, punk::tcltestrun 0.4.0- in `runtests.tcl` - the G-161 multi-line-banner-tolerant parser with result_expected capture). Rationale: a punk-kit `[interpreter]` boot pre-registers its kit-stamped package versions, and an unversioned require satisfiable by such a registration never fires `package unknown` - the freshly-added bootsupport tm path is never even scanned, so a fossilized kit copy silently wins and then skews against modern modules pulled in by versioned requires (the historic punk86 failure: kit punk::args 0.1.0 loaded, then punk::path 0.4.0- died on `invalid command name "punk::args::define"`). Floored requires reject the fossil and resolve the bootsupport copy. The punk86 kit itself is mapped in `src/runtime/mapvfs.config` (8.6.17 dyn tclkit + punk8win.vfs, remapped 2026-07-21). Suites that spawn children of `[info nameofexecutable]` additionally need kit content to be current: kit children boot with kit-stamped modules preloaded from `_vfscommon.vfs`, so run `make.tcl vfscommonupdate` + `make.tcl bake` after module changes such suites depend on (punkcheck's concurrency.test floors its child-side punkcheck require so a stale kit fails loud in the child log instead of mysteriously). Native tclsh remains the preferred runner interpreter.
- Run the full source-tree suite with `<tcl_interpreter> src/tests/runtests.tcl`.
- Use `-include-paths` with directory glob patterns relative to `src/tests/`, forward slashes — `modules/punk/args/***` runs that whole subtree (`X/***` deliberately excludes files directly in `X`; bare `X` is files-directly-in-X only). The flag accepts a space-separated list of patterns and may also be repeated, with all occurrences accumulating (`-multiple 1` as of 2026-07-10; previously the last flag silently won). Single-file targeting: `-include-paths modules/punk/args/testsuites/args dynamic.test`.

12
src/tests/testsupport/child_test_runner.tcl

@ -60,6 +60,18 @@ set ::argc [llength $tcltestoptions]
package require tcltest
tcltest::configure {*}$tcltestoptions
if {[info commands ::lpop] eq ""} {
#Native Tcl 8.6 child: modules under test commonly parse via punk::args::parse, which uses
#lpop. punk::lib installs its validated forward-compat family (lpop, ledit, lremove, ...) as
#global aliases whenever the builtins are absent (parity pinned by modules/punk/lib
#compat.test) - the child-process mirror of the toplevel and singleproc-testinterp guards in
#runtests.tcl. No-op on Tcl 8.7+/9. This is builtin-parity shimming for the 8.6 runner leg,
#not a package preload of the kind the leanness note below forbids: on 8.7+/9 children the
#same commands exist as builtins, so both legs present the same command surface.
#(floored like those guards - fossil-rejection; prefer-latest selects the dev module anyway)
package require punk::lib 0.5.1-
}
#Lean children (2026-07-19 cleanup): the shellrun preload + no-op runx warmup that
#previously mirrored the singleproc testinterp here were removed after the suites'
#implicit punk::* dependencies were made explicit (17 files gained package require lines

Loading…
Cancel
Save