authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-10-04 20:53:19+02:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-10-04 20:53:19+02:00
log3539cad176779c2807ed72d88fd455f5de140575
tree4ab82e02d4af9b2bb33e3e8a10798e0ba7619d8a
parentd9cd4d087648c6d83e22dda6a4b82929a72fc771
signaturebadge-check Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

test: remove standalone sigpipe test

This should be restored, but there's no point keeping disabled code that's just going to bitrot. https://github.com/ziglang/zig/issues/25466

3 files changed, 0 insertions(+), 68 deletions(-)

test/standalone/build.zig.zon-5
......@@ -138,11 +138,6 @@
138138 .issue_12706 = .{
139139 .path = "issue_12706",
140140 },
141 // TODO This test is disabled for doing naughty things in the build script.
142 // The logic needs to get moved to a child process instead of build.zig.
143 //.sigpipe = .{
144 // .path = "sigpipe",
145 //},
146141 .strip_empty_loop = .{
147142 .path = "strip_empty_loop",
148143 },
test/standalone/sigpipe/breakpipe.zig deleted-19
......@@ -1,19 +0,0 @@
1const std = @import("std");
2const build_options = @import("build_options");
3
4pub const std_options: std.Options = .{
5 .keep_sigpipe = build_options.keep_sigpipe,
6};
7
8pub fn main() !void {
9 const pipe = try std.posix.pipe();
10 std.posix.close(pipe[0]);
11 _ = std.posix.write(pipe[1], "a") catch |err| switch (err) {
12 error.BrokenPipe => {
13 try std.fs.File.stdout().writeAll("BrokenPipe\n");
14 std.posix.exit(123);
15 },
16 else => |e| return e,
17 };
18 unreachable;
19}
test/standalone/sigpipe/build.zig deleted-44
......@@ -1,44 +0,0 @@
1const std = @import("std");
2const posix = std.posix;
3
4pub fn build(b: *std.build.Builder) !void {
5 const test_step = b.step("test", "Test it");
6 b.default_step = test_step;
7
8 // TODO signal handling code has no business being in a build script.
9 // this logic needs to move to a file called parent.zig which is
10 // added as an executable.
11
12 //if (!std.os.have_sigpipe_support) {
13 // return;
14 //}
15
16 // This test runs "breakpipe" as a child process and that process
17 // depends on inheriting a SIGPIPE disposition of "default".
18 {
19 const act = posix.Sigaction{
20 .handler = .{ .handler = posix.SIG.DFL },
21 .mask = posix.sigemptyset(),
22 .flags = 0,
23 };
24 try posix.sigaction(posix.SIG.PIPE, &act, null);
25 }
26
27 for ([_]bool{ false, true }) |keep_sigpipe| {
28 const options = b.addOptions();
29 options.addOption(bool, "keep_sigpipe", keep_sigpipe);
30 const exe = b.addExecutable(.{
31 .name = "breakpipe",
32 .root_source_file = b.path("breakpipe.zig"),
33 });
34 exe.addOptions("build_options", options);
35 const run = b.addRunArtifact(exe);
36 if (keep_sigpipe) {
37 run.addCheck(.{ .expect_term = .{ .Signal = std.posix.SIG.PIPE } });
38 } else {
39 run.addCheck(.{ .expect_stdout_exact = "BrokenPipe\n" });
40 run.addCheck(.{ .expect_term = .{ .Exited = 123 } });
41 }
42 test_step.dependOn(&run.step);
43 }
44}