authorgravatar for spexguy070@gmail.comMartin Wickham <spexguy070@gmail.com> 2021-12-06 15:57:19-06:00
committergravatar for spexguy070@gmail.comMartin Wickham <spexguy070@gmail.com> 2021-12-06 15:57:19-06:00
log592499404527b49e9d09a8fa358a8d702e61f614
tree8adc92ad08bded7ab08fd224a4c6d9ff405511fa
parent3771e7766767f1011bbee7b77fcc52360018fbf1

Fix run() for test_exe steps


1 files changed, 6 insertions(+), 2 deletions(-)

lib/std/build.zig+6-2
......@@ -1775,7 +1775,7 @@ pub const LibExeObjStep = struct {
17751775 /// Creates a `RunStep` with an executable built with `addExecutable`.
17761776 /// Add command line arguments with `addArg`.
17771777 pub fn run(exe: *LibExeObjStep) *RunStep {
1778 assert(exe.kind == .exe);
1778 assert(exe.kind == .exe or exe.kind == .test_exe);
17791779
17801780 // It doesn't have to be native. We catch that if you actually try to run it.
17811781 // Consider that this is declarative; the run step may not be run unless a user
......@@ -1783,6 +1783,10 @@ pub const LibExeObjStep = struct {
17831783 const run_step = RunStep.create(exe.builder, exe.builder.fmt("run {s}", .{exe.step.name}));
17841784 run_step.addArtifactArg(exe);
17851785
1786 if (exe.kind == .test_exe) {
1787 run_step.addArg(exe.builder.zig_exe);
1788 }
1789
17861790 if (exe.vcpkg_bin_path) |path| {
17871791 run_step.addPathDir(path);
17881792 }
......@@ -2065,7 +2069,7 @@ pub const LibExeObjStep = struct {
20652069 /// Returns the generated header file.
20662070 /// This function can only be called for libraries or object files which have `emit_h` set.
20672071 pub fn getOutputHSource(self: *LibExeObjStep) FileSource {
2068 assert(self.kind != .exe);
2072 assert(self.kind != .exe and self.kind != .test_exe and self.kind != .@"test");
20692073 assert(self.emit_h);
20702074 return FileSource{ .generated = &self.output_h_path_source };
20712075 }