Allow setting test filter in zig build test (#909)

Example usage:

  $ zig build test -Dtest-filter=definition
This commit is contained in:
Alex Kladov 2023-01-17 17:40:26 +00:00 committed by GitHub
parent 93abb8cdd5
commit 6949989ece
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -163,6 +163,11 @@ pub fn build(b: *std.build.Builder) !void {
test_step.dependOn(b.getInstallStep()); test_step.dependOn(b.getInstallStep());
var tests = b.addTest("tests/tests.zig"); var tests = b.addTest("tests/tests.zig");
tests.setFilter(b.option(
[]const u8,
"test-filter",
"Skip tests that do not match filter",
));
if (coverage) { if (coverage) {
const src_dir = b.pathJoin(&.{ b.build_root, "src" }); const src_dir = b.pathJoin(&.{ b.build_root, "src" });