tangled
alpha
login
or
join now
zzstoatzz.io
/
music-atmosphere-feed
0
fork
atom
bsky feeds about music
music-atmosphere-feed.plyr.fm/
bsky
feed
zig
0
fork
atom
overview
issues
pulls
pipelines
move test imports to main.zig, remove test_root.zig
zzstoatzz.io
2 months ago
fa18087c
732eb398
1/1
ci.yml
success
14s
+10
-8
3 changed files
expand all
collapse all
unified
split
build.zig
src
main.zig
test_root.zig
+5
-2
build.zig
···
46
46
const run_step = b.step("run", "Run the feed server");
47
47
run_step.dependOn(&run_cmd.step);
48
48
49
49
-
// tests
49
49
+
// tests - use main.zig as root, tests in all imported modules run automatically
50
50
const tests = b.addTest(.{
51
51
.root_module = b.createModule(.{
52
52
-
.root_source_file = b.path("src/test_root.zig"),
52
52
+
.root_source_file = b.path("src/main.zig"),
53
53
.target = target,
54
54
.optimize = optimize,
55
55
.imports = &.{
56
56
+
.{ .name = "websocket", .module = websocket.module("websocket") },
57
57
+
.{ .name = "zqlite", .module = zqlite.module("zqlite") },
56
58
.{ .name = "zat", .module = zat.module("zat") },
57
59
},
58
60
}),
59
61
});
62
62
+
tests.linkLibC();
60
63
61
64
const run_tests = b.addRunArtifact(tests);
62
65
const test_step = b.step("test", "Run unit tests");
+5
src/main.zig
···
75
75
try posix.setsockopt(fd, posix.SOL.SOCKET, posix.SO.RCVTIMEO, &timeout);
76
76
try posix.setsockopt(fd, posix.SOL.SOCKET, posix.SO.SNDTIMEO, &timeout);
77
77
}
78
78
+
79
79
+
test {
80
80
+
_ = @import("feed/filter.zig");
81
81
+
_ = @import("server/stats.zig");
82
82
+
}
-6
src/test_root.zig
···
1
1
-
// test root - imports modules to run their tests
2
2
-
3
3
-
test {
4
4
-
_ = @import("feed/filter.zig");
5
5
-
_ = @import("server/stats.zig");
6
6
-
}