platform: the huge pages test skips where the kernel or emulator has no such switch

This commit is contained in:
2026-10-22 20:46:59 +02:00
parent 98283e1569
commit 065a97588b
+6 -1
View File
@@ -29,7 +29,12 @@ pub fn disable() DisableError!void {
} }
test "disable takes effect for the process" { test "disable takes effect for the process" {
try disable(); disable() catch |err| switch (err) {
// qemu-user, which runs the aarch64 suite, rejects the option the way
// a pre-3.15 kernel does.
error.Unsupported => return error.SkipZigTest,
error.Unexpected => return err,
};
const rc = linux.prctl(@intFromEnum(linux.PR.GET_THP_DISABLE), 0, 0, 0, 0); const rc = linux.prctl(@intFromEnum(linux.PR.GET_THP_DISABLE), 0, 0, 0, 0);
try std.testing.expectEqual(linux.E.SUCCESS, linux.errno(rc)); try std.testing.expectEqual(linux.E.SUCCESS, linux.errno(rc));
try std.testing.expectEqual(@as(usize, 1), rc); try std.testing.expectEqual(@as(usize, 1), rc);