| ... | @@ -1,11 +1,22 @@ | ... | @@ -1,11 +1,22 @@ |
| 1 | const std = @import("std"); | 1 | const std = @import("std"); |
| 2 | | 2 | |
| 3 | pub fn build(b: *std.build.Builder) void { | 3 | pub fn build(b: *std.build.Builder) void { |
| | 4 | const target = b.standardTargetOptions(.{}); |
| | 5 | const mode = b.option(std.builtin.Mode, "mode", "") orelse .Debug; |
| | 6 | |
| 4 | _ = b.addModule( | 7 | _ = b.addModule( |
| 5 | "extras", | 8 | "extras", |
| 6 | .{ .source_file = .{ .path = "src/lib.zig" } }, | 9 | .{ .source_file = .{ .path = "src/lib.zig" } }, |
| 7 | ); | 10 | ); |
| 8 | | 11 | |
| | 12 | const exe_unit_tests = b.addTest(.{ |
| | 13 | .root_source_file = .{ .path = "src/lib.zig" }, |
| | 14 | .target = target, |
| | 15 | .optimize = mode, |
| | 16 | }); |
| | 17 | |
| | 18 | const run_exe_unit_tests = b.addRunArtifact(exe_unit_tests); |
| | 19 | |
| 9 | const test_step = b.step("test", "dummy test step to pass CI checks"); | 20 | const test_step = b.step("test", "dummy test step to pass CI checks"); |
| 10 | _ = test_step; | 21 | test_step.dependOn(&run_exe_unit_tests.step); |
| 11 | } | 22 | } |