+5
-2
build.zig
+5
-2
build.zig
···
46
const run_step = b.step("run", "Run the feed server");
47
run_step.dependOn(&run_cmd.step);
48
49
-
// tests
50
const tests = b.addTest(.{
51
.root_module = b.createModule(.{
52
-
.root_source_file = b.path("src/test_root.zig"),
53
.target = target,
54
.optimize = optimize,
55
.imports = &.{
56
.{ .name = "zat", .module = zat.module("zat") },
57
},
58
}),
59
});
60
61
const run_tests = b.addRunArtifact(tests);
62
const test_step = b.step("test", "Run unit tests");
···
46
const run_step = b.step("run", "Run the feed server");
47
run_step.dependOn(&run_cmd.step);
48
49
+
// tests - use main.zig as root, tests in all imported modules run automatically
50
const tests = b.addTest(.{
51
.root_module = b.createModule(.{
52
+
.root_source_file = b.path("src/main.zig"),
53
.target = target,
54
.optimize = optimize,
55
.imports = &.{
56
+
.{ .name = "websocket", .module = websocket.module("websocket") },
57
+
.{ .name = "zqlite", .module = zqlite.module("zqlite") },
58
.{ .name = "zat", .module = zat.module("zat") },
59
},
60
}),
61
});
62
+
tests.linkLibC();
63
64
const run_tests = b.addRunArtifact(tests);
65
const test_step = b.step("test", "Run unit tests");
+5
src/main.zig
+5
src/main.zig