diff --git a/src/tests/AGENTS.md b/src/tests/AGENTS.md index 98543685..1543fcf3 100644 --- a/src/tests/AGENTS.md +++ b/src/tests/AGENTS.md @@ -41,6 +41,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. The punk86-kit route for runtests remains broken (kit/dev module skew loading dev punk::path) - use a native 8.6 tclsh for 8.6 legs. - Run the full source-tree suite with ` 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`. - Use `-exclude-paths` (same syntax and accumulation) to remove directories from discovery — `**`|`***` tails prune the matched subtree, other matches drop only that directory's files, and exclusion wins for the same file. It gives broad runs a middle ground between full and targeted: e.g `-exclude-paths shell/***` when no built kit is present, or skipping a heavy suite family unrelated to the change. diff --git a/src/tests/runtests.tcl b/src/tests/runtests.tcl index a57398f5..c2dfe15a 100644 --- a/src/tests/runtests.tcl +++ b/src/tests/runtests.tcl @@ -39,6 +39,14 @@ if {$libdir_arch ni $::auto_path} { #inspection tool (boot ~1s instead of ~11s) for humans, agents and the runner-targeting #regression suite (runner/testsuites/discovery/pathdiscovery.test). package require punk::args +if {[info commands ::lpop] eq ""} { + #Native Tcl 8.6 interpreter: no builtin lpop, which punk::args::parse (and later runner code) + #uses. punk::lib installs its validated forward-compat family (lpop, ledit, lremove, ...) as + #global aliases whenever the builtins are absent - behavioural parity with the 8.7/9 builtins + #is pinned by modules/punk/lib/testsuites/lib/compat.test. Guarded: on Tcl 8.7+/9 this never + #runs, preserving the G-093 fast two-stage boot for -discover-only. + package require punk::lib +} #test-file discovery + -include-paths/-exclude-paths filtering (G-093) - shared with the #runner-targeting regression suite @@ -1150,6 +1158,14 @@ foreach testfile_relative $testfiles { testinterp eval [list set ::argc [llength $tcltestoptions]] testinterp eval {package require tcltest} testinterp eval [list tcltest::configure {*}$tcltestoptions] + testinterp eval { + if {[info commands ::lpop] eq ""} { + #native Tcl 8.6 testinterp: shellrun's runx (the runner's capture mechanism) parses via + #punk::args::parse, which uses lpop. punk::lib installs the validated compat aliases + #(parity pinned by modules/punk/lib compat.test). No-op on Tcl 8.7+/9. + package require punk::lib + } + } testinterp eval {package require shellrun} #puts ">>>> [testinterp eval { # set result ""