Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -609,6 +609,8 @@ pub fn build(b: *std.Build) !void {
.optimize_modes = optimization_modes,
.test_filters = test_filters,
.test_target_filters = test_target_filters,
// Highest RSS observed in any test case was exactly 1465151488 on x86_64-linux CI.
.max_rss = 1758181785,
})) |test_libc_step| test_step.dependOn(test_libc_step);
}

Expand Down
1 change: 1 addition & 0 deletions ci/x86_64-linux-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ stage3-release/bin/zig build \
stage3-release/bin/zig build test docs \
--maxrss 21000000000 \
-Dlldb=$HOME/deps/lldb-zig/Release-e0a42bb34/bin/lldb \
-Dlibc-test-path=$HOME/deps/libc-test-f2bac77 \
-fqemu \
-fwasmtime \
-Dstatic-llvm \
Expand Down
2 changes: 1 addition & 1 deletion test/libc.zig
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ pub fn addCases(cases: *tests.LibcContext) void {
cases.addLibcTestCase("regression/lseek-large.c", false, .{});
cases.addLibcTestCase("regression/malloc-0.c", true, .{});
// "regression/malloc-brk-fail.c": QEMU OOM
cases.addLibcTestCase("regression/malloc-oom.c", false, .{}); // wasi-libc: requires t_memfill
// cases.addLibcTestCase("regression/malloc-oom.c", false, .{}); // wasi-libc: requires t_memfill; QEMU OOM
cases.addLibcTestCase("regression/mbsrtowcs-overflow.c", true, .{});
cases.addLibcTestCase("regression/memmem-oob-read.c", true, .{});
cases.addLibcTestCase("regression/memmem-oob.c", true, .{});
Expand Down
3 changes: 3 additions & 0 deletions test/src/Libc.zig
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ pub const Options = struct {
optimize_modes: []const std.builtin.OptimizeMode,
test_filters: []const []const u8,
test_target_filters: []const []const u8,
max_rss: usize,
};

const TestCase = struct {
Expand Down Expand Up @@ -100,6 +101,7 @@ pub fn addTarget(libc: *const Libc, target: std.Build.ResolvedTarget) void {
const exe = libc.b.addExecutable(.{
.name = test_case.name,
.root_module = mod,
.max_rss = libc.options.max_rss,
});

const run = libc.b.addRunArtifact(exe);
Expand All @@ -108,6 +110,7 @@ pub fn addTarget(libc: *const Libc, target: std.Build.ResolvedTarget) void {
run.expectStdErrEqual("");
run.expectStdOutEqual("");
run.expectExitCode(0);
run.step.max_rss = libc.options.max_rss;

libc.root_step.dependOn(&run.step);
}
Expand Down