| ... | ... | @@ -5,22 +5,21 @@ pub fn build(b: *std.Build) void { |
| 5 | 5 | const mode = b.option(std.builtin.Mode, "mode", "") orelse .Debug; |
| 6 | 6 | const disable_llvm = b.option(bool, "disable_llvm", "use the non-llvm zig codegen") orelse false; |
| 7 | 7 | |
| 8 | | _ = b.addModule( |
| 9 | | "extras", |
| 10 | | .{ .root_source_file = b.path("src/lib.zig") }, |
| 11 | | ); |
| 8 | const mod = b.addModule("extras", .{ |
| 9 | .root_source_file = b.path("src/lib.zig"), |
| 10 | }); |
| 12 | 11 | |
| 13 | 12 | const tests = b.addTest(.{ |
| 14 | | .root_source_file = b.path("src/lib.zig"), |
| 13 | .root_source_file = b.path("test.zig"), |
| 15 | 14 | .target = target, |
| 16 | 15 | .optimize = mode, |
| 17 | 16 | }); |
| 17 | tests.root_module.addImport("extras", mod); |
| 18 | 18 | tests.use_llvm = !disable_llvm; |
| 19 | 19 | tests.use_lld = !disable_llvm; |
| 20 | 20 | |
| 21 | | const run_tests = b.addRunArtifact(tests); |
| 22 | | run_tests.has_side_effects = true; |
| 23 | | |
| 24 | | const test_step = b.step("test", "dummy test step to pass CI checks"); |
| 25 | | test_step.dependOn(&run_tests.step); |
| 21 | const test_step = b.step("test", "Run all library tests"); |
| 22 | const tests_run = b.addRunArtifact(tests); |
| 23 | tests_run.has_side_effects = true; |
| 24 | test_step.dependOn(&tests_run.step); |
| 26 | 25 | } |