From 625827ac4c488b161f00224ccebbbda13a02c649 Mon Sep 17 00:00:00 2001 From: Not-Nik Date: Sun, 14 Apr 2024 22:03:33 +0200 Subject: [PATCH] Add test step --- build.zig | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/build.zig b/build.zig index 5529204..3f944fa 100755 --- a/build.zig +++ b/build.zig @@ -194,6 +194,23 @@ pub fn build(b: *std.Build) !void { const raylib = rl.getModuleInternal(b); const raylib_math = rl.math.getModuleInternal(b); + const raylib_test = b.addTest(.{ + .root_source_file = .{ .path = "lib/raylib-zig.zig" }, + .target = target, + .optimize = optimize, + }); + + const raylib_math_test = b.addTest(.{ + .root_source_file = .{ .path = "lib/raylib-zig-math.zig" }, + .target = target, + .optimize = optimize, + }); + raylib_math_test.addModule("raylib-zig", raylib); + + const test_step = b.step("test", "Check for library compilation errors"); + test_step.dependOn(&raylib_test.step); + test_step.dependOn(&raylib_math_test.step); + for (examples) |ex| { if (target.getOsTag() == .emscripten) { const exe_lib = emcc.compileForEmscripten(b, ex.name, ex.path, target, optimize);