quicker zig build test

This commit is contained in:
2026-02-12 14:06:15 +02:00
parent 47c9f3e038
commit 2998dd1122
2 changed files with 9 additions and 10 deletions

View File

@@ -18,12 +18,12 @@ This is written with help from LLM:
Quick test: Quick test:
zig build test zig build fmt test
Full test with all supported compilers and valgrind (run before commit, Full test and static analysis with all supported compilers and valgrind (run
takes a while): before commit, takes a while):
zig build fmt && zig build -Dvalgrind zig build -Dvalgrind
# Debugging tips # Debugging tips

View File

@@ -116,19 +116,18 @@ pub fn build(b: *std.Build) !void {
lint_step.dependOn(&cppcheck.step); lint_step.dependOn(&cppcheck.step);
} }
const all_step = b.step("all", "Run fmt check, lint, and tests with all compilers");
all_step.dependOn(lint_step);
const fmt_check = b.addSystemCommand(&.{ "clang-format", "--dry-run", "-Werror" }); const fmt_check = b.addSystemCommand(&.{ "clang-format", "--dry-run", "-Werror" });
for (all_c_files ++ headers) |f| fmt_check.addFileArg(b.path(f)); for (all_c_files ++ headers) |f| fmt_check.addFileArg(b.path(f));
fmt_check.expectExitCode(0); fmt_check.expectExitCode(0);
all_step.dependOn(&fmt_check.step); b.default_step.dependOn(&fmt_check.step);
for (compilers) |compiler| { for (compilers) |compiler| {
addTestStep(b, all_step, target, optimize, compiler, false, valgrind, test_timeout); addTestStep(b, b.default_step, target, optimize, compiler, false, valgrind, test_timeout);
} }
b.default_step = all_step; const all_step = b.step("all", "Run fmt check, lint, and tests with all compilers");
all_step.dependOn(b.default_step);
all_step.dependOn(lint_step);
} }
fn addTestStep( fn addTestStep(