Fix tests failing to trigger in CI
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details

This commit is contained in:
kayomn 2023-07-10 23:44:27 +01:00
parent 2218bc5c77
commit 7b266fde58
2 changed files with 18 additions and 5 deletions

View File

@ -18,17 +18,27 @@ pub fn build(b: *std.Build) void {
}); });
b.installArtifact(create: { b.installArtifact(create: {
const runner_exe = b.addExecutable(.{ const compile_step = b.addExecutable(.{
.name = "runner", .name = "runner",
.root_source_file = .{ .path = "source/runner.zig" }, .root_source_file = .{ .path = "source/runner.zig" },
.target = target, .target = target,
.optimize = optimize, .optimize = optimize,
}); });
runner_exe.addModule("ona", ona_module); compile_step.addModule("ona", ona_module);
runner_exe.linkLibC(); compile_step.linkLibC();
runner_exe.linkSystemLibrary("SDL2"); compile_step.linkSystemLibrary("SDL2");
break: create runner_exe; break: create compile_step;
});
b.step("test", "Run unit tests").dependOn(create: {
const tests = b.addTest(.{
.root_source_file = .{.path = "source/test.zig"},
.target = target,
.optimize = optimize,
});
break: create &tests.step;
}); });
} }

3
source/test.zig Normal file
View File

@ -0,0 +1,3 @@
const coral = @import("coral");
const ona = @import("ona");