wcc,ww: @test under separate compilation (M4 E1, #79)
Make `ww test --sep` work the Hare +test way: the -T synth test-main emits a qualified test.run, and the test package is injected as an ordinary separately-compiled dependency instead of splicing lib/test source into a flat unit. Additive — combined stays the default and 910/997 are untouched (their migration is M4 E2). - compiler synth (both stages): the -T main emits N_DOT test.run plus a synthetic N_USE "test"; cmd/wcc/check.c + selfhost/cmd/wcc/check.ww. - driver (both stages): build_one_sep gains is_test, injects the test package as a root dep, and passes -T to the root; do_test --sep routes a single-file test through the sep producer; cmd/ww/main.c + selfhost/cmd/ww/main.ww. - 989_septest_run gate: ww test --sep on both stages, run-exit + cs==ww byte-id of the sep .s, non-vacuous. The synth's test.run is left ty_err by the checker in both regimes (lib/test's run is scope-keyed under "" not "test"; cgen emits the correct CALL via run's //ww:module test directive) — wwstage tolerates it like cstage (rule-10). The genuine fix, module-keying run under sep so the call type-resolves, is #80. w6c_ww/wwdump_ww/ww_ww move (their embedded source changed); w6a_ww/w6l_ww and the combined codegen output are unchanged.
This commit is contained in:
12
Makefile
12
Makefile
@@ -569,6 +569,7 @@ TESTS = $(BIN)/test_smoke $(BIN)/test_lex $(BIN)/test_parse $(BIN)/test_check \
|
||||
$(BIN)/test_separchive_run \
|
||||
$(BIN)/test_pkgcache_run \
|
||||
$(BIN)/test_c6soak_run \
|
||||
$(BIN)/test_septest_run \
|
||||
$(BIN)/test_floatlit_run \
|
||||
$(BIN)/test_checked_run \
|
||||
$(BIN)/test_floatarr_run \
|
||||
@@ -3219,6 +3220,17 @@ $(BIN)/test_c6soak_run: test/wcc/989_c6soak_run.c $(BIN)/ww $(BIN)/ww_ww \
|
||||
$(BIN)/w6l $(BIN)/w6l_ww $(LIB)/libwwrt.a | $(BIN)
|
||||
$(CC) $(CFLAGS) -o $@ $<
|
||||
|
||||
# 989_septest_run — M4 E1 (#79-B) gate: `ww test --sep`. Drives BOTH driver
|
||||
# stages on a passing + a failing inline @test fixture (COLD per-(case,stage)
|
||||
# WW_PKGCACHE), asserting run-exit (pass=0, fail=1 = the non-vacuity teeth),
|
||||
# cs==ww per-pkg .s/.wwi (rule 10), and the synth `CALL test.run` in __root.s
|
||||
# (the -T synth fired under sep). Needs both driver + both compiler + both
|
||||
# linker stages + libwwrt.a for the test-binary link.
|
||||
$(BIN)/test_septest_run: test/wcc/989_septest_run.c $(BIN)/ww $(BIN)/ww_ww \
|
||||
$(BIN)/w6c $(BIN)/w6c_ww $(BIN)/w6a $(BIN)/w6a_ww \
|
||||
$(BIN)/w6l $(BIN)/w6l_ww $(LIB)/libwwrt.a | $(BIN)
|
||||
$(CC) $(CFLAGS) -o $@ $<
|
||||
|
||||
$(BIN)/test_floatlit_run: test/wcc/989_floatlit_run.c $(BIN)/ww $(BIN)/w6c \
|
||||
$(BIN)/w6c_ww $(BIN)/w6a $(BIN)/w6l $(LIB)/libwwrt.a | $(BIN)
|
||||
$(CC) $(CFLAGS) -o $@ $<
|
||||
|
||||
Reference in New Issue
Block a user