Skip to content

Commit

Permalink
zig: always include test steps when building for single target
Browse files Browse the repository at this point in the history
  • Loading branch information
ripperi committed Sep 27, 2024
1 parent c6c8b7b commit 56677d9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 56677d9

Please sign in to comment.