test(asm): Phase 0.0 — corpus target-gating + .build JSON config
Adds per-example build/run directives to the corpus runner via an optional
`expected/<name>.build` JSON sidecar (`BuildConfig { aot, target }`), replacing
the standalone `.aot` marker. Threads `--target` into the run/build/ir spawns
and gates the execute path on host arch+os match; a cross-target example fails
loudly ("ir-only mode not yet implemented") pending Phase 0.1.
- corpus_run.test.zig: BuildConfig + std.json parse (unknown-key => error),
hostMatchesTarget (shorthand-expand + arch/os token match, arm64->aarch64),
withTarget argv helper; unit tests for both.
- migrate 1226/1227 `.aot` markers -> `.build` { "aot": true }.
- lock fixture 1638-platform-target-host (`.build` { "target": "macos" }).
Test-infra only; no compiler code. zig build test green (646 corpus, 444 unit).
This commit is contained in:
9
examples/1638-platform-target-host.sx
Normal file
9
examples/1638-platform-target-host.sx
Normal file
@@ -0,0 +1,9 @@
|
||||
// Phase 0 (ASM stream) test-infra lock: exercises the `<name>.build` JSON
|
||||
// config + `--target` threading + the host-match EXECUTE path of the corpus
|
||||
// runner. The companion `.build` pins the HOST target (`{ "target": "macos" }`
|
||||
// resolves to the host arch+os), so the runner threads `--target` and still
|
||||
// runs the example natively — its stdout is asserted as usual.
|
||||
#import "modules/std.sx";
|
||||
main :: () {
|
||||
print("target-host ok\n");
|
||||
}
|
||||
1
examples/expected/1226-ffi-export-fn.build
Normal file
1
examples/expected/1226-ffi-export-fn.build
Normal file
@@ -0,0 +1 @@
|
||||
{ "aot": true }
|
||||
1
examples/expected/1227-ffi-export-fn-rename.build
Normal file
1
examples/expected/1227-ffi-export-fn-rename.build
Normal file
@@ -0,0 +1 @@
|
||||
{ "aot": true }
|
||||
1
examples/expected/1638-platform-target-host.build
Normal file
1
examples/expected/1638-platform-target-host.build
Normal file
@@ -0,0 +1 @@
|
||||
{ "target": "macos" }
|
||||
1
examples/expected/1638-platform-target-host.exit
Normal file
1
examples/expected/1638-platform-target-host.exit
Normal file
@@ -0,0 +1 @@
|
||||
0
|
||||
1
examples/expected/1638-platform-target-host.stderr
Normal file
1
examples/expected/1638-platform-target-host.stderr
Normal file
@@ -0,0 +1 @@
|
||||
|
||||
1
examples/expected/1638-platform-target-host.stdout
Normal file
1
examples/expected/1638-platform-target-host.stdout
Normal file
@@ -0,0 +1 @@
|
||||
target-host ok
|
||||
Reference in New Issue
Block a user