diff options
Diffstat (limited to 'build.zig')
| -rw-r--r-- | build.zig | 23 |
1 files changed, 23 insertions, 0 deletions
@@ -57,4 +57,27 @@ pub fn build(b: *std.Build) void { const run_step = b.step("run", "Run the app"); run_step.dependOn(&run_cmd.step); + + const test_options = b.addOptions(); + test_options.addOption(bool, "have_ffmpeg", false); + test_options.addOption(bool, "have_hap", false); + test_options.addOption(bool, "have_tsv", false); + + const test_step = b.step("test", "Run unit tests"); + const test_module = b.createModule(.{ + .root_source_file = b.path("src/gl.zig"), + .target = target, + }); + + test_module.addOptions("build_config", test_options); + + const tests = b.addTest(.{ + .root_module = test_module, + }); + tests.linkLibC(); + tests.linkSystemLibrary("glfw3"); + tests.linkSystemLibrary("epoxy"); + + const run_unit_tests = b.addRunArtifact(tests); + test_step.dependOn(&run_unit_tests.step); } |
