commit 8eafca4c9bbe38dc194b0cf02db96afcb7dd0494 (tree)
parent dfbea20d45c9e9e843ad7b4a3d13479dc38d3977
Author: Alex Rønne Petersen <alex@alexrp.com>
Date: Sat, 25 Apr 2026 13:13:47 +0200
test: compile all JIT'd commands as part of test-cli
Diffstat:
4 files changed, 18 insertions(+), 10 deletions(-)
diff --git a/ci/aarch64-macos-release.sh b/ci/aarch64-macos-release.sh
@@ -55,9 +55,6 @@ stage3-release/bin/zig build test docs \
stage3-release/bin/zig build test-std --fuzz=1K -Dno-lib -Dfuzz-only -Doptimize=ReleaseSafe
stage3-release/bin/zig build test-std --fuzz=1K -Dno-lib -Dfuzz-only -Doptimize=Debug
-# Ensure that reduce compiles
-stage3-release/bin/zig reduce -h
-
# Ensure that stage3 and stage4 are byte-for-byte identical.
stage3-release/bin/zig build \
--maxrss ${ZSF_MAX_RSS:-0} \
diff --git a/ci/x86_64-linux-release.sh b/ci/x86_64-linux-release.sh
@@ -77,9 +77,6 @@ stage3-release/bin/zig build test docs \
stage3-release/bin/zig build test-std --fuzz=1K -Dno-lib -Dfuzz-only -Doptimize=ReleaseSafe
stage3-release/bin/zig build test-std --fuzz=1K -Dno-lib -Dfuzz-only -Doptimize=Debug
-# Ensure that reduce compiles
-stage3-release/bin/zig reduce -h
-
# Ensure that stage3 and stage4 are byte-for-byte identical.
stage3-release/bin/zig build \
--prefix stage4-release \
diff --git a/ci/x86_64-windows-release.ps1 b/ci/x86_64-windows-release.ps1
@@ -61,10 +61,6 @@ CheckLastExitCode
# stage3-release\bin\zig.exe build test-std --fuzz=1K -Dno-lib -Dfuzz-only -Doptimize=Debug
# CheckLastExitCode
-# Ensure that reduce compiles
-stage3-release\bin\zig.exe build reduce -h
-CheckLastExitCode
-
# Ensure that stage3 and stage4 are byte-for-byte identical.
Write-Output "Build and compare stage4..."
stage3-release\bin\zig.exe build `
diff --git a/test/tests.zig b/test/tests.zig
@@ -2238,6 +2238,24 @@ pub fn addCliTests(b: *std.Build) *Step {
const s = std.fs.path.sep_str;
{
+ // Test that all JIT'd commands compile.
+ for (&[_][]const u8{
+ "libc",
+ "objcopy",
+ "objdump",
+ "rc",
+ "reduce",
+ "std",
+ }) |cmd| {
+ const run_help = b.addSystemCommand(&.{ b.graph.zig_exe, cmd, "--help" });
+ run_help.setName(b.fmt("zig {s} --help", .{cmd}));
+ run_help.expectStdErrEqual("");
+ run_help.expectExitCode(0);
+ step.dependOn(&run_help.step);
+ }
+ }
+
+ {
// Test `zig init`.
const tmp_path = b.tmpPath();
const init_exe = b.addSystemCommand(&.{ b.graph.zig_exe, "init" });