| ... | @@ -1627,6 +1627,7 @@ pub const TestStep = struct { | ... | @@ -1627,6 +1627,7 @@ pub const TestStep = struct { |
| 1627 | filter: ?[]const u8, | 1627 | filter: ?[]const u8, |
| 1628 | target: Target, | 1628 | target: Target, |
| 1629 | exec_cmd_args: ?[]const ?[]const u8, | 1629 | exec_cmd_args: ?[]const ?[]const u8, |
| | 1630 | include_dirs: ArrayList([]const u8), |
| 1630 | | 1631 | |
| 1631 | pub fn init(builder: &Builder, root_src: []const u8) TestStep { | 1632 | pub fn init(builder: &Builder, root_src: []const u8) TestStep { |
| 1632 | const step_name = builder.fmt("test {}", root_src); | 1633 | const step_name = builder.fmt("test {}", root_src); |
| ... | @@ -1641,6 +1642,7 @@ pub const TestStep = struct { | ... | @@ -1641,6 +1642,7 @@ pub const TestStep = struct { |
| 1641 | .link_libs = BufSet.init(builder.allocator), | 1642 | .link_libs = BufSet.init(builder.allocator), |
| 1642 | .target = Target { .Native = {} }, | 1643 | .target = Target { .Native = {} }, |
| 1643 | .exec_cmd_args = null, | 1644 | .exec_cmd_args = null, |
| | 1645 | .include_dirs = ArrayList([]const u8).init(builder.allocator), |
| 1644 | }; | 1646 | }; |
| 1645 | } | 1647 | } |
| 1646 | | 1648 | |
| ... | @@ -1648,6 +1650,10 @@ pub const TestStep = struct { | ... | @@ -1648,6 +1650,10 @@ pub const TestStep = struct { |
| 1648 | self.verbose = value; | 1650 | self.verbose = value; |
| 1649 | } | 1651 | } |
| 1650 | | 1652 | |
| | 1653 | pub fn addIncludeDir(self: &TestStep, path: []const u8) void { |
| | 1654 | self.include_dirs.append(path) catch unreachable; |
| | 1655 | } |
| | 1656 | |
| 1651 | pub fn setBuildMode(self: &TestStep, mode: builtin.Mode) void { | 1657 | pub fn setBuildMode(self: &TestStep, mode: builtin.Mode) void { |
| 1652 | self.build_mode = mode; | 1658 | self.build_mode = mode; |
| 1653 | } | 1659 | } |
| ... | @@ -1746,6 +1752,11 @@ pub const TestStep = struct { | ... | @@ -1746,6 +1752,11 @@ pub const TestStep = struct { |
| 1746 | } | 1752 | } |
| 1747 | } | 1753 | } |
| 1748 | | 1754 | |
| | 1755 | for (self.include_dirs.toSliceConst()) |include_path| { |
| | 1756 | try zig_args.append("-isystem"); |
| | 1757 | try zig_args.append(builder.pathFromRoot(include_path)); |
| | 1758 | } |
| | 1759 | |
| 1749 | for (builder.include_paths.toSliceConst()) |include_path| { | 1760 | for (builder.include_paths.toSliceConst()) |include_path| { |
| 1750 | try zig_args.append("-isystem"); | 1761 | try zig_args.append("-isystem"); |
| 1751 | try zig_args.append(builder.pathFromRoot(include_path)); | 1762 | try zig_args.append(builder.pathFromRoot(include_path)); |