test: make runww the cstage-only T1 behavioral gate

Per the tier+stage split (USER-approved): the routine wwstage-behavior
run is redundant -- T2 byte-id (cstage.s vs wwstage.s, strictly more
sensitive) plus T1's cstage run together cover both stages. Drop the
wwstage path from runww; cstage==wwstage convergence moves to a separate
pre-push byte-id tool (T2). Update the test-run target comment to match.
This commit is contained in:
2026-06-22 00:16:53 +09:00
parent c7eeb475b1
commit 70ef7681a6
2 changed files with 12 additions and 15 deletions

View File

@@ -3667,8 +3667,8 @@ test-unit: all sizelint peellint $(TESTS)
# ---- test-run: ww-native behavior harness (fold 2) ---------------------
# Drives test/runww.ww over every test/wcc/data/<name>/case.ww, building
# and running each case through BOTH compiler stages and checking its
# leading `//ww:` directive. The harness prints `runww: all ok` and exits
# and running each case through the cstage `ww` driver (T1) and checking
# its leading `//ww:` directive. The harness prints `runww: all ok` and exits
# 0 only if every case passes; the target propagates that exit code. NOT
# yet wired into `make test` (fold 6). See test/runww.ww header.
RUNWW_CASES = $(wildcard test/wcc/data/*/case.ww)

View File

@@ -1,10 +1,19 @@
// runww — ww-native behavior-test harness, the analog of Go's
// test/run.go. Each case file under test/wcc/data/<name>/case.ww carries
// a leading `//ww:` directive describing how to test it; runww builds (and
// optionally runs) the case through BOTH compiler stages and checks the
// optionally runs) the case through the cstage `ww` driver and checks the
// directive holds. This replaces the per-test C harnesses that embedded ww
// source as C string literals and duplicated fork/exec/grep boilerplate.
//
// This is T1: the routine behavioral-correctness gate, cstage-only. The
// wwstage-behavior run is deliberately NOT here — per the rob/USER tier+stage
// split, a wwstage miscompile is already caught by T2 (cstage.s vs wwstage.s
// byte-id over the same case.ww corpus, strictly more sensitive than re-running
// behavior) or by T1's own cstage run (the both-wrong-identical blind spot is
// cstage being wrong, which only a behavioral check on cstage catches). So
// rule-10 stage-symmetry is enforced by T2 (a separate pre-push tool), not by
// runww; routine runs stay cstage-only.
//
// Directives (first `//ww:` line of the case):
// //ww:run compile + execute, expect exit 0
// //ww:run-exit N compile + execute, expect exit N
@@ -248,8 +257,6 @@ export fn main() int = {
case void => { };
};
let cdrv: str = joinp(bin, "/ww");
let wdrv: str = joinp(bin, "/ww_ww");
let wwok: bool = os.access(wdrv, 1i32) == 0; // X_OK gate, mirrors C harness
// Fixed scratch paths: the pilot drives cases sequentially in one
// process, so reuse is safe; per-pid uniqueness for parallel invocation
@@ -289,16 +296,6 @@ export fn main() int = {
fail += 1;
};
if (wwok) {
total += 1;
if (runcase(wdrv, casepath, &d, errpath, tmpout)) {
pr("PASS wwstage "); pr(casepath); pr("\n");
} else {
pr("FAIL wwstage "); pr(casepath); pr("\n");
fail += 1;
};
};
ci += 1;
};