aboutsummaryrefslogtreecommitdiff
path: root/test/tests.zig
diff options
context:
space:
mode:
authorJacob Young <jacobly0@users.noreply.github.com>2025-05-20 22:59:07 -0400
committerJacob Young <jacobly0@users.noreply.github.com>2025-05-20 23:02:51 -0400
commitcdba1d591aae2f5ac5dcd5ae186f5696f218710c (patch)
tree2eb316d86c9a3b0dccc58e69de6beefee445ab6e /test/tests.zig
parentfe855691f6f742a14678cb617422977c2a55be39 (diff)
downloadzig-cdba1d591aae2f5ac5dcd5ae186f5696f218710c.tar.gz
zig-cdba1d591aae2f5ac5dcd5ae186f5696f218710c.zip
test-cli: port build options test to new build system API
Since we need testing for passing `--build-file` and `--cache-dir` together anyway, use it to test the disabled build options test.
Diffstat (limited to 'test/tests.zig')
-rw-r--r--test/tests.zig27
1 files changed, 17 insertions, 10 deletions
diff --git a/test/tests.zig b/test/tests.zig
index 04c89444df..a25d3527c0 100644
--- a/test/tests.zig
+++ b/test/tests.zig
@@ -1657,16 +1657,23 @@ pub fn addCliTests(b: *std.Build) *Step {
}
{
- // TODO this should move to become a CLI test rather than standalone
- // cases.addBuildFile("test/standalone/options/build.zig", .{
- // .extra_argv = &.{
- // "-Dbool_true",
- // "-Dbool_false=false",
- // "-Dint=1234",
- // "-De=two",
- // "-Dstring=hello",
- // },
- // });
+ const run_test = b.addSystemCommand(&.{
+ b.graph.zig_exe,
+ "build",
+ "test",
+ "-Dbool_true",
+ "-Dbool_false=false",
+ "-Dint=1234",
+ "-De=two",
+ "-Dstring=hello",
+ });
+ run_test.addArg("--build-file");
+ run_test.addFileArg(b.path("test/standalone/options/build.zig"));
+ run_test.addArg("--cache-dir");
+ run_test.addFileArg(.{ .cwd_relative = b.cache_root.join(b.allocator, &.{}) catch @panic("OOM") });
+ run_test.setName("test build options");
+
+ step.dependOn(&run_test.step);
}
return step;