From 56677d9e1450ff5edd61050d78de43c9a839b023 Mon Sep 17 00:00:00 2001 From: Santeri Hannula Date: Fri, 27 Sep 2024 23:32:35 +0300 Subject: [PATCH] zig: always include test steps when building for single target --- build.zig | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/build.zig b/build.zig index f8d7420f3e..2ac88948c0 100644 --- a/build.zig +++ b/build.zig @@ -14,6 +14,7 @@ const BuildCfg = struct { pace: []const u8, binary_name: []const u8, flags: []const []const u8 = &.{}, + include_test_steps: bool = true, cpu_dbg: bool = false, mem_dbg: bool = false, c3dbg: bool = false, @@ -117,9 +118,10 @@ pub fn build(b: *std.Build) !void { .mem_dbg = mem_dbg, .c3dbg = c3dbg, .snapshot_validation = snapshot_validation, + .include_test_steps = !all, }; - if (release or all) { + if (all) { for (targets) |t| { try build_single(b, b.resolveTargetQuery(t), optimize, build_cfg); } @@ -890,7 +892,7 @@ fn build_single( // Tests // - if (target.query.isNativeCpu() and target.query.isNativeOs()) { + if (cfg.include_test_steps) { // pkg_ur add_test( b,