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
const exe_tests = b.addTest(.{ .root_source_file = .{ .path = "src/run_tests.zig" } });
try common(exe_tests, options);
const tests = b.addTest(.{ .root_source_file = .{ .path = "src/run_tests.zig" } });
try common(tests, options);
tests.single_threaded = true;
const run_tests = b.addRunArtifact(tests);
// step
const test_step = b.step("test", "Run unit tests");
test_step.dependOn(&exe_tests.step);
test_step.dependOn(&run_tests.step);
}
fn common(