From e91b2c03cb15508b61a7f51b295ce9ffcee6d459 Mon Sep 17 00:00:00 2001 From: prajwalch Date: Tue, 9 Jul 2024 18:45:51 +0545 Subject: [PATCH] chore(build.zig): Update for zig `v0.13.0` Signed-off-by: prajwalch --- build.zig | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/build.zig b/build.zig index 6ca127a..85f26e5 100644 --- a/build.zig +++ b/build.zig @@ -6,9 +6,14 @@ pub fn build(b: *std.Build) void { const target = b.standardTargetOptions(.{}); const optimize = b.standardOptimizeOption(.{}); - const main_tests = b.addTest(.{ .root_source_file = b.path("src/test.zig") }); const test_step = b.step("test", "Run library tests"); - test_step.dependOn(&main_tests.step); + const unit_tests = b.addTest(.{ + .root_source_file = b.path("src/test.zig"), + .target = target, + .optimize = optimize, + }); + const run_unit_tests = b.addRunArtifact(unit_tests); + test_step.dependOn(&run_unit_tests.step); const docs_test = b.addTest(.{ .root_source_file = b.path("src/lib.zig") }); const install_docs = b.addInstallDirectory(.{ @@ -30,6 +35,7 @@ pub fn build(b: *std.Build) void { }); const install_example = b.addInstallArtifact(example, .{}); example.root_module.addImport("yazap", yazap_mod); + examples_step.dependOn(&example.step); examples_step.dependOn(&install_example.step); } }