test/wcc: carrier ownership repair and driver-contract adaptation

Every surviving carrier now owns its artifacts: checked mkdir/mkdtemp/
fopen acquisition, one all-exit cleanup funnel per carrier, ENOENT-
tolerant checked unlinks, exact-path deletion (rm -rf only for an
owned pid-keyed dir or a .sepwork beneath one), and cleanup failure
fails a passing carrier without overwriting its diagnostic. In the
same pass the carriers adapt to the driver contract this branch lands:
--sep and WW_PKGCACHE are gone, -S and the /tmp/ww_run_<pid> scratch
contract are asserted, and rows whose runtime or reject coverage moved
to test/wcc/data fixtures or test/lang @test owners are trimmed to the
byte/artifact/diagnostic observations only they can make.

Repair and adaptation ride together because most files interleave both
in the same hunks; splitting would manufacture intermediate carrier
states that never existed and cannot run against either driver.
This commit is contained in:
2026-08-07 23:02:47 +09:00
parent b2899dd8d3
commit a95a7a316b
132 changed files with 7573 additions and 6172 deletions

View File

@@ -1,5 +1,5 @@
/*
* 993_ww_ww — phase-10 marker for the ww-side driver port.
* 993_ww_ww — explicit bootstrap gate for the ww-side driver port.
*
* Diffs the C-built `ww` against the ww-built `ww_ww`. Both drivers
* orchestrate the same w6c/w6a/w6l, so the resulting binaries must be
@@ -143,8 +143,8 @@ run_exit_code(const char *bin, const char *driver, int code)
/* Stage a program that fails to compile, run it via the named driver,
* and return the exit code. Pins the build-step caller contract: a
* failing build must still report failure (non-zero) — the #16 fix that
* lets procrun return the real exit code must not regress this, since the
* failing build must still report failure (non-zero). The process mechanism's
* exact exit-code return must not regress this, since the
* w6c/w6a/w6l callers only test `!= 0`. */
static int
run_build_fail(const char *bin, const char *driver)
@@ -268,8 +268,7 @@ main(void)
}
unlink(hello_src);
/* #16: `ww_ww run` must propagate the child program's real exit code
* (the shared procrun helper was collapsing every non-zero exit to 1).
/* #16: `ww_ww run` must propagate the child program's real exit code.
* Table-driven; the non-zero rows fail under the old collapse-to-1.
* 255 is the single-byte boundary (WEXITSTATUS max). The C ww driver
* is the reference (do_run -> WEXITSTATUS); assert ww_ww matches it