authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-10-14 21:29:57+02:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2025-10-14 21:29:57+02:00
log4edebf40d53c7e69afd088c9967f13ab8aafe1fd
tree76820d0a66c88498507f4a85828b1294549d8fdd
parentc8b34bc8a342663d920e15a389820f02d9e911a3
parentfcfdf99122b17a928c144c3d70418b35e6b1620e
signaturebadge-check Signed by PGP key B5690EEEBB952194

Merge pull request #25402 from alexrp/libc-test-ci

`ci`: enable running libc-test on `x86_64-linux-release`

4 files changed, 7 insertions(+), 1 deletions(-)

build.zig+2
...@@ -615,6 +615,8 @@ pub fn build(b: *std.Build) !void {...@@ -615,6 +615,8 @@ pub fn build(b: *std.Build) !void {
615 .optimize_modes = optimization_modes,615 .optimize_modes = optimization_modes,
616 .test_filters = test_filters,616 .test_filters = test_filters,
617 .test_target_filters = test_target_filters,617 .test_target_filters = test_target_filters,
618 // Highest RSS observed in any test case was exactly 1465151488 on x86_64-linux CI.
619 .max_rss = 1758181785,
618 })) |test_libc_step| test_step.dependOn(test_libc_step);620 })) |test_libc_step| test_step.dependOn(test_libc_step);
619}621}
620622
ci/x86_64-linux-release.sh+1
...@@ -56,6 +56,7 @@ stage3-release/bin/zig build \...@@ -56,6 +56,7 @@ stage3-release/bin/zig build \
56stage3-release/bin/zig build test docs \56stage3-release/bin/zig build test docs \
57 --maxrss 21000000000 \57 --maxrss 21000000000 \
58 -Dlldb=$HOME/deps/lldb-zig/Release-e0a42bb34/bin/lldb \58 -Dlldb=$HOME/deps/lldb-zig/Release-e0a42bb34/bin/lldb \
59 -Dlibc-test-path=$HOME/deps/libc-test-f2bac77 \
59 -fqemu \60 -fqemu \
60 -fwasmtime \61 -fwasmtime \
61 -Dstatic-llvm \62 -Dstatic-llvm \
test/libc.zig+1-1
...@@ -91,7 +91,7 @@ pub fn addCases(cases: *tests.LibcContext) void {...@@ -91,7 +91,7 @@ pub fn addCases(cases: *tests.LibcContext) void {
91 cases.addLibcTestCase("regression/lseek-large.c", false, .{});91 cases.addLibcTestCase("regression/lseek-large.c", false, .{});
92 cases.addLibcTestCase("regression/malloc-0.c", true, .{});92 cases.addLibcTestCase("regression/malloc-0.c", true, .{});
93 // "regression/malloc-brk-fail.c": QEMU OOM93 // "regression/malloc-brk-fail.c": QEMU OOM
94 cases.addLibcTestCase("regression/malloc-oom.c", false, .{}); // wasi-libc: requires t_memfill94 // cases.addLibcTestCase("regression/malloc-oom.c", false, .{}); // wasi-libc: requires t_memfill; QEMU OOM
95 cases.addLibcTestCase("regression/mbsrtowcs-overflow.c", true, .{});95 cases.addLibcTestCase("regression/mbsrtowcs-overflow.c", true, .{});
96 cases.addLibcTestCase("regression/memmem-oob-read.c", true, .{});96 cases.addLibcTestCase("regression/memmem-oob-read.c", true, .{});
97 cases.addLibcTestCase("regression/memmem-oob.c", true, .{});97 cases.addLibcTestCase("regression/memmem-oob.c", true, .{});
test/src/Libc.zig+3
...@@ -10,6 +10,7 @@ pub const Options = struct {...@@ -10,6 +10,7 @@ pub const Options = struct {
10 optimize_modes: []const std.builtin.OptimizeMode,10 optimize_modes: []const std.builtin.OptimizeMode,
11 test_filters: []const []const u8,11 test_filters: []const []const u8,
12 test_target_filters: []const []const u8,12 test_target_filters: []const []const u8,
13 max_rss: usize,
13};14};
1415
15const TestCase = struct {16const TestCase = struct {
...@@ -100,6 +101,7 @@ pub fn addTarget(libc: *const Libc, target: std.Build.ResolvedTarget) void {...@@ -100,6 +101,7 @@ pub fn addTarget(libc: *const Libc, target: std.Build.ResolvedTarget) void {
100 const exe = libc.b.addExecutable(.{101 const exe = libc.b.addExecutable(.{
101 .name = test_case.name,102 .name = test_case.name,
102 .root_module = mod,103 .root_module = mod,
104 .max_rss = libc.options.max_rss,
103 });105 });
104106
105 const run = libc.b.addRunArtifact(exe);107 const run = libc.b.addRunArtifact(exe);
...@@ -108,6 +110,7 @@ pub fn addTarget(libc: *const Libc, target: std.Build.ResolvedTarget) void {...@@ -108,6 +110,7 @@ pub fn addTarget(libc: *const Libc, target: std.Build.ResolvedTarget) void {
108 run.expectStdErrEqual("");110 run.expectStdErrEqual("");
109 run.expectStdOutEqual("");111 run.expectStdOutEqual("");
110 run.expectExitCode(0);112 run.expectExitCode(0);
113 run.step.max_rss = libc.options.max_rss;
111114
112 libc.root_step.dependOn(&run.step);115 libc.root_step.dependOn(&run.step);
113 }116 }