aboutsummaryrefslogtreecommitdiffstats
path: root/build.zig
diff options
context:
space:
mode:
authors-ol <s+removethis@s-ol.nu>2026-04-10 22:23:19 +0000
committers-ol <s+removethis@s-ol.nu>2026-04-10 22:23:19 +0000
commitf2641e05588349d58ef6feaa2e174ca28f842450 (patch)
treeb3771ca9fd32c4c335e4a84c64c0850f10de7652 /build.zig
parentsupport arrays of uniforms, remove finished sources (diff)
downloadglsl-view-f2641e05588349d58ef6feaa2e174ca28f842450.tar.gz
glsl-view-f2641e05588349d58ef6feaa2e174ca28f842450.zip
add some tests
Diffstat (limited to 'build.zig')
-rw-r--r--build.zig23
1 files changed, 23 insertions, 0 deletions
diff --git a/build.zig b/build.zig
index e51b961..bdbaaba 100644
--- a/build.zig
+++ b/build.zig
@@ -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);
}