alex abd960873c test/standalone: reinstate std.ChildProcess tests
67d5bfef removed std.ChildProcess tests, suggesting to make them
standalone instead. This commit does exactly that after the
bug creating SIGPIPE in ReleaseFast is no more with LLVM 15.0.5.

Thanks to @x1ddos for the idea with the compile artifacts and PR
improvements.
2023-07-25 10:57:45 -07:00

32 lines
819 B
Zig

const std = @import("std");
const builtin = @import("builtin");
pub fn build(b: *std.Build) void {
const test_step = b.step("test", "Test it");
b.default_step = test_step;
const optimize: std.builtin.OptimizeMode = .Debug;
const target: std.zig.CrossTarget = .{};
if (builtin.os.tag == .wasi) return;
const child = b.addExecutable(.{
.name = "child",
.root_source_file = .{ .path = "child.zig" },
.optimize = optimize,
.target = target,
});
const main = b.addExecutable(.{
.name = "main",
.root_source_file = .{ .path = "main.zig" },
.optimize = optimize,
.target = target,
});
const run = b.addRunArtifact(main);
run.addArtifactArg(child);
run.expectExitCode(0);
test_step.dependOn(&run.step);
}