mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-05-02 03:44:39 +00:00
pkg: add test targets
This commit is contained in:
@@ -4,7 +4,7 @@ pub fn build(b: *std.Build) !void {
|
||||
const target = b.standardTargetOptions(.{});
|
||||
const optimize = b.standardOptimizeOption(.{});
|
||||
|
||||
_ = b.addModule("pixman", .{ .source_file = .{ .path = "main.zig" } });
|
||||
const module = b.addModule("pixman", .{ .source_file = .{ .path = "main.zig" } });
|
||||
|
||||
const upstream = b.dependency("pixman", .{});
|
||||
const lib = b.addStaticLibrary(.{
|
||||
@@ -66,6 +66,22 @@ pub fn build(b: *std.Build) !void {
|
||||
});
|
||||
|
||||
b.installArtifact(lib);
|
||||
|
||||
{
|
||||
const test_exe = b.addTest(.{
|
||||
.name = "test",
|
||||
.root_source_file = .{ .path = "main.zig" },
|
||||
.target = target,
|
||||
.optimize = optimize,
|
||||
});
|
||||
test_exe.linkLibrary(lib);
|
||||
var it = module.dependencies.iterator();
|
||||
while (it.next()) |entry| test_exe.addModule(entry.key_ptr.*, entry.value_ptr.*);
|
||||
|
||||
const tests_run = b.addRunArtifact(test_exe);
|
||||
const test_step = b.step("test", "Run tests");
|
||||
test_step.dependOn(&tests_run.step);
|
||||
}
|
||||
}
|
||||
|
||||
const srcs: []const []const u8 = &.{
|
||||
|
||||
Reference in New Issue
Block a user