fix standalone test

This commit is contained in:
Vojtech Antosik 2025-03-30 15:02:17 +02:00
parent 807c14a956
commit 44f7c0717f
No known key found for this signature in database
GPG key ID: 1B4CFBC7E5EE59A7
2 changed files with 5 additions and 2 deletions

View file

@ -11,7 +11,7 @@ pub fn main() !void {
_ = args.next() orelse unreachable; // skip executable name
const child_path = args.next() orelse unreachable;
const argv = if (builtin.os.tag == .windows) &.{""} else &.{ child_path, "30" };
const argv = &.{""};
var child = std.process.Child.init(argv, gpa);
child.stdin_behavior = .Ignore;
child.stderr_behavior = .Ignore;
@ -23,7 +23,9 @@ pub fn main() !void {
}
if (child.spawn()) {
return error.SpawnSilencedError;
if (child.waitForSpawn()) {
return error.SpawnSilencedError;
} else |_| {}
} else |_| {}
child = std.process.Child.init(&.{ child_path, "30" }, gpa);

View file

@ -24,6 +24,7 @@ pub fn main() !void {
child.stdout_behavior = .Pipe;
child.detached = true;
try child.spawn();
try child.waitForSpawn();
defer {
_ = child.kill() catch {};
}