Skip to content

Commit e39dec3

Browse files
committed
Fix running tests for zig master (0.15.0)
1 parent 3dee891 commit e39dec3

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

build.zig

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,24 @@ pub fn build(b: *std.Build) void {
44
const target = b.standardTargetOptions(.{});
55
const optimize = b.standardOptimizeOption(.{});
66

7-
const itertools = b.addModule("itertools", .{
8-
.root_source_file = b.path("src/itertools.zig"),
7+
const zig_itertools = b.addModule("zig_itertools", .{
8+
.root_source_file = b.path("src/zig_itertools.zig"),
99
.target = target,
1010
.optimize = optimize,
1111
});
1212

13-
const lib_tests = b.addTest(.{
14-
.root_source_file = b.path("src/itertools.zig"),
13+
const test_module = b.addModule("zig_itertools_test", .{
14+
.root_source_file = b.path("tests/tests.zig"),
1515
.target = target,
1616
.optimize = optimize,
1717
});
1818

19-
lib_tests.root_module.addImport("itertools", itertools);
19+
const lib_tests = b.addTest(.{ .root_module = test_module });
20+
21+
lib_tests.root_module.addImport("zig_itertools", zig_itertools);
2022

2123
const run_unit_tests = b.addRunArtifact(lib_tests);
2224

2325
const test_step = b.step("test", "Run unit tests");
2426
test_step.dependOn(&run_unit_tests.step);
25-
}
27+
}

0 commit comments

Comments
 (0)