build: run test suite

This commit is contained in:
Pierre Tachoire
2023-09-28 07:43:40 +02:00
parent 6786c8a3d8
commit a8c4977ed8

View File

@@ -64,12 +64,14 @@ pub fn build(b: *std.build.Builder) !void {
// ---- // ----
// compile // compile
const exe_tests = b.addTest(.{ .root_source_file = .{ .path = "src/run_tests.zig" } }); const tests = b.addTest(.{ .root_source_file = .{ .path = "src/run_tests.zig" } });
try common(exe_tests, options); try common(tests, options);
tests.single_threaded = true;
const run_tests = b.addRunArtifact(tests);
// step // step
const test_step = b.step("test", "Run unit tests"); const test_step = b.step("test", "Run unit tests");
test_step.dependOn(&exe_tests.step); test_step.dependOn(&run_tests.step);
} }
fn common( fn common(