File tree 1 file changed +6
-2
lines changed 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -1775,14 +1775,18 @@ pub const LibExeObjStep = struct {
1775
1775
/// Creates a `RunStep` with an executable built with `addExecutable`.
1776
1776
/// Add command line arguments with `addArg`.
1777
1777
pub fn run (exe : * LibExeObjStep ) * RunStep {
1778
- assert (exe .kind == .exe );
1778
+ assert (exe .kind == .exe or exe . kind == .test_exe );
1779
1779
1780
1780
// It doesn't have to be native. We catch that if you actually try to run it.
1781
1781
// Consider that this is declarative; the run step may not be run unless a user
1782
1782
// option is supplied.
1783
1783
const run_step = RunStep .create (exe .builder , exe .builder .fmt ("run {s}" , .{exe .step .name }));
1784
1784
run_step .addArtifactArg (exe );
1785
1785
1786
+ if (exe .kind == .test_exe ) {
1787
+ run_step .addArg (exe .builder .zig_exe );
1788
+ }
1789
+
1786
1790
if (exe .vcpkg_bin_path ) | path | {
1787
1791
run_step .addPathDir (path );
1788
1792
}
@@ -2065,7 +2069,7 @@ pub const LibExeObjStep = struct {
2065
2069
/// Returns the generated header file.
2066
2070
/// This function can only be called for libraries or object files which have `emit_h` set.
2067
2071
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" );
2069
2073
assert (self .emit_h );
2070
2074
return FileSource { .generated = & self .output_h_path_source };
2071
2075
}
You can’t perform that action at this time.
0 commit comments