authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2026-04-25 13:13:47+02:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2026-05-01 00:53:39+02:00
log8eafca4c9bbe38dc194b0cf02db96afcb7dd0494
tree589db3584c8a04493b35e9bccf3c4b88eaa3be03
parentdfbea20d45c9e9e843ad7b4a3d13479dc38d3977
signaturebadge-check Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

test: compile all JIT'd commands as part of test-cli


4 files changed, 18 insertions(+), 10 deletions(-)

ci/aarch64-macos-release.sh-3
...@@ -55,9 +55,6 @@ stage3-release/bin/zig build test docs \...@@ -55,9 +55,6 @@ stage3-release/bin/zig build test docs \
55stage3-release/bin/zig build test-std --fuzz=1K -Dno-lib -Dfuzz-only -Doptimize=ReleaseSafe55stage3-release/bin/zig build test-std --fuzz=1K -Dno-lib -Dfuzz-only -Doptimize=ReleaseSafe
56stage3-release/bin/zig build test-std --fuzz=1K -Dno-lib -Dfuzz-only -Doptimize=Debug56stage3-release/bin/zig build test-std --fuzz=1K -Dno-lib -Dfuzz-only -Doptimize=Debug
5757
58# Ensure that reduce compiles
59stage3-release/bin/zig reduce -h
60
61# Ensure that stage3 and stage4 are byte-for-byte identical.58# Ensure that stage3 and stage4 are byte-for-byte identical.
62stage3-release/bin/zig build \59stage3-release/bin/zig build \
63 --maxrss ${ZSF_MAX_RSS:-0} \60 --maxrss ${ZSF_MAX_RSS:-0} \
ci/x86_64-linux-release.sh-3
...@@ -77,9 +77,6 @@ stage3-release/bin/zig build test docs \...@@ -77,9 +77,6 @@ stage3-release/bin/zig build test docs \
77stage3-release/bin/zig build test-std --fuzz=1K -Dno-lib -Dfuzz-only -Doptimize=ReleaseSafe77stage3-release/bin/zig build test-std --fuzz=1K -Dno-lib -Dfuzz-only -Doptimize=ReleaseSafe
78stage3-release/bin/zig build test-std --fuzz=1K -Dno-lib -Dfuzz-only -Doptimize=Debug78stage3-release/bin/zig build test-std --fuzz=1K -Dno-lib -Dfuzz-only -Doptimize=Debug
7979
80# Ensure that reduce compiles
81stage3-release/bin/zig reduce -h
82
83# Ensure that stage3 and stage4 are byte-for-byte identical.80# Ensure that stage3 and stage4 are byte-for-byte identical.
84stage3-release/bin/zig build \81stage3-release/bin/zig build \
85 --prefix stage4-release \82 --prefix stage4-release \
ci/x86_64-windows-release.ps1-4
...@@ -61,10 +61,6 @@ CheckLastExitCode...@@ -61,10 +61,6 @@ CheckLastExitCode
61# stage3-release\bin\zig.exe build test-std --fuzz=1K -Dno-lib -Dfuzz-only -Doptimize=Debug61# stage3-release\bin\zig.exe build test-std --fuzz=1K -Dno-lib -Dfuzz-only -Doptimize=Debug
62# CheckLastExitCode62# CheckLastExitCode
6363
64# Ensure that reduce compiles
65stage3-release\bin\zig.exe build reduce -h
66CheckLastExitCode
67
68# Ensure that stage3 and stage4 are byte-for-byte identical.64# Ensure that stage3 and stage4 are byte-for-byte identical.
69Write-Output "Build and compare stage4..."65Write-Output "Build and compare stage4..."
70stage3-release\bin\zig.exe build `66stage3-release\bin\zig.exe build `
test/tests.zig+18
...@@ -2237,6 +2237,24 @@ pub fn addCliTests(b: *std.Build) *Step {...@@ -2237,6 +2237,24 @@ pub fn addCliTests(b: *std.Build) *Step {
2237 const step = b.step("test-cli", "Test the command line interface");2237 const step = b.step("test-cli", "Test the command line interface");
2238 const s = std.fs.path.sep_str;2238 const s = std.fs.path.sep_str;
22392239
2240 {
2241 // Test that all JIT'd commands compile.
2242 for (&[_][]const u8{
2243 "libc",
2244 "objcopy",
2245 "objdump",
2246 "rc",
2247 "reduce",
2248 "std",
2249 }) |cmd| {
2250 const run_help = b.addSystemCommand(&.{ b.graph.zig_exe, cmd, "--help" });
2251 run_help.setName(b.fmt("zig {s} --help", .{cmd}));
2252 run_help.expectStdErrEqual("");
2253 run_help.expectExitCode(0);
2254 step.dependOn(&run_help.step);
2255 }
2256 }
2257
2240 {2258 {
2241 // Test `zig init`.2259 // Test `zig init`.
2242 const tmp_path = b.tmpPath();2260 const tmp_path = b.tmpPath();