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