diff options
| author | s-ol <s+removethis@s-ol.nu> | 2026-04-10 22:23:19 +0000 |
|---|---|---|
| committer | s-ol <s+removethis@s-ol.nu> | 2026-04-10 22:23:19 +0000 |
| commit | f2641e05588349d58ef6feaa2e174ca28f842450 (patch) | |
| tree | b3771ca9fd32c4c335e4a84c64c0850f10de7652 /build.zig | |
| parent | support arrays of uniforms, remove finished sources (diff) | |
| download | glsl-view-f2641e05588349d58ef6feaa2e174ca28f842450.tar.gz glsl-view-f2641e05588349d58ef6feaa2e174ca28f842450.zip | |
add some tests
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); } |
