test: ww-native behavior harness (runww.ww) + 2 pilot cases
First piece of the Go-model test rebuild: runww.ww is a ww program (the test/run.go analog) that drives compiler cases through BOTH stages and asserts behavior/diagnostics. Directives //ww:run / //ww:run-exit N / //ww:error "<substr>" / //ww:compile; spawn+stderr-capture lift the driver's procrun (main.ww:160) + dup2(2). The //ww:error check requires rc!=0 AND the diagnostic substring (the #20 non-vacuity guard -- a crash can't pass), and a malformed error directive fails loudly. Bulk corpus migration + ww test wiring are follow-up folds; case spawns need os.envp() (#28) and per-pid /tmp paths (#29) first.
This commit is contained in:
8
test/wcc/data/runww_enum_reject/case.ww
Normal file
8
test/wcc/data/runww_enum_reject/case.ww
Normal file
@@ -0,0 +1,8 @@
|
||||
//ww:error "enum storage type must be integer"
|
||||
// Lifted from test/wcc/850_enum_reject.c reject_row "nonint_stor": a
|
||||
// non-integer enum storage type must be LOUD-rejected by both stages.
|
||||
// The directive's substring is the shared diagnostic body (no file:line
|
||||
// prefix, which differs cstage vs wwstage) — the #20 non-vacuity anchor.
|
||||
package main;
|
||||
type e = enum f64 { A };
|
||||
fn main() i32 = { return e.A as i32; };
|
||||
7
test/wcc/data/runww_enum_run/case.ww
Normal file
7
test/wcc/data/runww_enum_run/case.ww
Normal file
@@ -0,0 +1,7 @@
|
||||
//ww:run-exit 6
|
||||
// Lifted from test/wcc/850_enum_reject.c ok_row "distinct": a valid enum
|
||||
// with forward member arithmetic must BUILD and run. main returns
|
||||
// e.A (0) + e.C (B+1 = 6) == 6, signalled via the process exit code.
|
||||
package main;
|
||||
type e = enum { A, B = 5, C = B + 1 };
|
||||
fn main() i32 = { return e.A as i32 + e.C as i32; };
|
||||
Reference in New Issue
Block a user