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 {
615615 .optimize_modes = optimization_modes,
616616 .test_filters = test_filters,
617617 .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,
618620 })) |test_libc_step| test_step.dependOn(test_libc_step);
619621}
620622
ci/x86_64-linux-release.sh+1
......@@ -56,6 +56,7 @@ stage3-release/bin/zig build \
5656stage3-release/bin/zig build test docs \
5757 --maxrss 21000000000 \
5858 -Dlldb=$HOME/deps/lldb-zig/Release-e0a42bb34/bin/lldb \
59 -Dlibc-test-path=$HOME/deps/libc-test-f2bac77 \
5960 -fqemu \
6061 -fwasmtime \
6162 -Dstatic-llvm \
test/libc.zig+1-1
......@@ -91,7 +91,7 @@ pub fn addCases(cases: *tests.LibcContext) void {
9191 cases.addLibcTestCase("regression/lseek-large.c", false, .{});
9292 cases.addLibcTestCase("regression/malloc-0.c", true, .{});
9393 // "regression/malloc-brk-fail.c": QEMU OOM
94 cases.addLibcTestCase("regression/malloc-oom.c", false, .{}); // wasi-libc: requires t_memfill
94 // cases.addLibcTestCase("regression/malloc-oom.c", false, .{}); // wasi-libc: requires t_memfill; QEMU OOM
9595 cases.addLibcTestCase("regression/mbsrtowcs-overflow.c", true, .{});
9696 cases.addLibcTestCase("regression/memmem-oob-read.c", true, .{});
9797 cases.addLibcTestCase("regression/memmem-oob.c", true, .{});
test/src/Libc.zig+3
......@@ -10,6 +10,7 @@ pub const Options = struct {
1010 optimize_modes: []const std.builtin.OptimizeMode,
1111 test_filters: []const []const u8,
1212 test_target_filters: []const []const u8,
13 max_rss: usize,
1314};
1415
1516const TestCase = struct {
......@@ -100,6 +101,7 @@ pub fn addTarget(libc: *const Libc, target: std.Build.ResolvedTarget) void {
100101 const exe = libc.b.addExecutable(.{
101102 .name = test_case.name,
102103 .root_module = mod,
104 .max_rss = libc.options.max_rss,
103105 });
104106
105107 const run = libc.b.addRunArtifact(exe);
......@@ -108,6 +110,7 @@ pub fn addTarget(libc: *const Libc, target: std.Build.ResolvedTarget) void {
108110 run.expectStdErrEqual("");
109111 run.expectStdOutEqual("");
110112 run.expectExitCode(0);
113 run.step.max_rss = libc.options.max_rss;
111114
112115 libc.root_step.dependOn(&run.step);
113116 }