ww test: fork-isolated record-and-continue harness (lib/test, both stages)
lib/test/run.ww: fork+wait4 runner; each @test runs in its own child, abort/SEGV/FPE decoded from wait-status, failures recorded and the run continues; exit = fail count. Tests are hermetic: module globals do not persist test-to-test (fresh fork image; sanctioned divergence from harec's shared-process __test_main, no setjmp/signal layer needed). -T synth (both stages) emits a module-global (str,*fn() void) table + return run(table) instead of straight-line calls. Driver twins bundle lib/test under test mode and gain ww test -c/-o (go test -c) so the byte-id gates diff the same artifact the real path builds. Gates 989/910/997 rewired onto it; new 911 pins record-and-continue across all three fault classes; 949 +3 rows. (#17-team commit-2)
This commit is contained in:
31
test/wcc/data/attest_record.ww
Normal file
31
test/wcc/data/attest_record.ww
Normal file
@@ -0,0 +1,31 @@
|
||||
// @test fixture for #17 record-and-continue: a mix of one passing test,
|
||||
// then the three runtime fault classes the lib/test fork+wait4 runner
|
||||
// must each catch and PROCEED past (failed assert → SIGABRT, nil deref →
|
||||
// SIGSEGV, divide-by-zero → SIGFPE), then a final passing test to prove
|
||||
// the run reaches the tail after every failure. Driver:
|
||||
// test/wcc/911_attest_record.c. The runner reports in source order, so
|
||||
// the expected per-test verdicts are pinned positionally there.
|
||||
|
||||
package data;
|
||||
|
||||
@test fn rec_pass_a() void = {
|
||||
assert(1 + 1 == 2);
|
||||
};
|
||||
|
||||
@test fn rec_assert() void = {
|
||||
assert(1 == 2);
|
||||
};
|
||||
|
||||
@test fn rec_segv() void = {
|
||||
let p: *i32 = nil: *i32;
|
||||
*p = 7i32;
|
||||
};
|
||||
|
||||
@test fn rec_div0() void = {
|
||||
let z: i32 = 0;
|
||||
let _: i32 = 1 / z;
|
||||
};
|
||||
|
||||
@test fn rec_pass_b() void = {
|
||||
assert(true);
|
||||
};
|
||||
Reference in New Issue
Block a user