authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2026-04-16 21:16:25+02:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2026-04-17 15:08:23+02:00
log6612e7cdb26a761392f129525872bd00758095c2
tree3b9cd080c9867109d0ced8dc5731fb61fb331d59
parent7ea8f842bc65cdaf046483b2bfe7948ebad16516
signaturebadge-check Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

libzigc: skip tests that are failing under various targets/conditions


7 files changed, 47 insertions(+), 0 deletions(-)

test/c/inttypes.zig+3
......@@ -10,6 +10,9 @@ test "imaxabs" {
1010}
1111
1212test "imaxdiv" {
13 if (builtin.target.cpu.arch.isPowerPC32()) return error.SkipZigTest; // TODO
14 if (builtin.target.cpu.arch == .s390x) return error.SkipZigTest; // TODO
15
1316 const expected: c.imaxdiv_t = .{ .quot = 9, .rem = 0 };
1417 try testing.expectEqual(expected, c.imaxdiv(9, 1));
1518}
test/c/math.zig+3
......@@ -54,6 +54,9 @@ fn testModf(comptime T: type) !void {
5454test "modf" {
5555 try testModf(f32);
5656 try testModf(f64);
57
58 if (builtin.target.cpu.arch.isPowerPC()) return error.SkipZigTest; // TODO
59
5760 try testModf(c_longdouble);
5861}
5962
test/c/search.zig+2
......@@ -11,6 +11,8 @@ const Node = extern struct {
1111};
1212
1313test "insque and remque" {
14 if (builtin.target.os.tag == .windows) return; // no insque/remque
15
1416 var first: Node = .{ .next = null, .prev = null };
1517 var second: Node = .{ .next = null, .prev = null };
1618 var third: Node = .{ .next = null, .prev = null };
test/c/stdlib.zig+16
......@@ -7,11 +7,15 @@ const math = std.math;
77const testing = std.testing;
88
99test "abs" {
10 if (builtin.target.cpu.arch.isMIPS64()) return error.SkipZigTest; // TODO
11
1012 const val: c_int = -10;
1113 try testing.expectEqual(10, c.abs(val));
1214}
1315
1416test "labs" {
17 if (builtin.target.cpu.arch.isMIPS64() and @sizeOf(usize) == 4) return error.SkipZigTest; // TODO
18
1519 const val: c_long = -10;
1620 try testing.expectEqual(10, c.labs(val));
1721}
......@@ -22,16 +26,28 @@ test "llabs" {
2226}
2327
2428test "div" {
29 if (builtin.target.cpu.arch.isLoongArch()) return error.SkipZigTest; // TODO
30 if (builtin.target.cpu.arch.isMIPS64()) return error.SkipZigTest; // TODO
31 if (builtin.target.cpu.arch.isPowerPC()) return error.SkipZigTest; // TODO
32 if (builtin.target.cpu.arch == .s390x) return error.SkipZigTest; // TODO
33
2534 const expected: c.div_t = .{ .quot = 5, .rem = 5 };
2635 try testing.expectEqual(expected, c.div(55, 10));
2736}
2837
2938test "ldiv" {
39 if (builtin.target.cpu.arch.isMIPS64() and @sizeOf(usize) == 4) return error.SkipZigTest; // TODO
40 if (builtin.target.cpu.arch.isPowerPC32()) return error.SkipZigTest; // TODO
41 if (builtin.target.cpu.arch == .s390x) return error.SkipZigTest; // TODO
42
3043 const expected: c.ldiv_t = .{ .quot = -6, .rem = 2 };
3144 try testing.expectEqual(expected, c.ldiv(38, -6));
3245}
3346
3447test "lldiv" {
48 if (builtin.target.cpu.arch.isPowerPC32()) return error.SkipZigTest; // TODO
49 if (builtin.target.cpu.arch == .s390x) return error.SkipZigTest; // TODO
50
3551 const expected: c.lldiv_t = .{ .quot = 1, .rem = 2 };
3652 try testing.expectEqual(expected, c.lldiv(5, 3));
3753}
test/c/stdlib/drand48.zig+8
......@@ -5,6 +5,8 @@ const c = std.c;
55const testing = std.testing;
66
77test "erand48" {
8 if (builtin.target.os.tag == .windows) return; // no erand48
9
810 var xsubi: [3]c_ushort = .{ 37174, 64810, 11603 };
911
1012 try testing.expectApproxEqAbs(0.8965, c.erand48(&xsubi), 0.0005);
......@@ -24,6 +26,10 @@ test "erand48" {
2426}
2527
2628test "jrand48" {
29 if (builtin.target.os.tag == .windows) return; // no jrand48
30
31 if (builtin.target.os.tag == .openbsd) return error.SkipZigTest; // TODO
32
2733 var xsubi: [3]c_ushort = .{ 25175, 11052, 45015 };
2834
2935 try testing.expectEqual(1699503220, c.jrand48(&xsubi));
......@@ -43,6 +49,8 @@ test "jrand48" {
4349}
4450
4551test "nrand48" {
52 if (builtin.target.os.tag == .windows) return; // no nrand48
53
4654 var xsubi: [3]c_ushort = .{ 546, 33817, 23389 };
4755
4856 try testing.expectEqual(914920692, c.nrand48(&xsubi));
test/c/strings.zig+11
......@@ -6,6 +6,8 @@ const mem = std.mem;
66const testing = std.testing;
77
88test "bzero" {
9 if (builtin.target.os.tag == .windows) return; // no bzero
10
911 var array: [10]u8 = [_]u8{ '1', '2', '3', '4', '5', '6', '7', '8', '9', '0' };
1012 var a = mem.zeroes([array.len]u8);
1113 a[9] = '0';
......@@ -31,8 +33,17 @@ fn testFfs(comptime T: type) !void {
3133}
3234
3335test "ffs" {
36 if (builtin.target.os.tag == .openbsd) return; // no ffsl/ffsll
37 if (builtin.target.os.tag == .windows) return; // no ffs
38
3439 try testFfs(c_int);
40
41 if (builtin.target.os.tag == .netbsd) return; // no ffsl/ffsll until 11
42
3543 try testFfs(c_long);
44
45 if (@sizeOf(usize) == 4) return error.SkipZigTest; // TODO
46
3647 try testFfs(c_longlong);
3748}
3849
test/c/unistd.zig+4
......@@ -5,6 +5,10 @@ const c = std.c;
55const testing = std.testing;
66
77test "swab" {
8 if (builtin.target.cpu.arch.isMIPS64() and @sizeOf(usize) == 4) return error.SkipZigTest; // TODO
9 if (builtin.target.cpu.arch == .x86_64 and @sizeOf(usize) == 4) return error.SkipZigTest; // TODO
10 if (builtin.target.os.tag == .netbsd) return error.SkipZigTest; // TODO
11
812 var a: [4]u8 = undefined;
913 @memset(a[0..], '\x00');
1014 c.swab("abcd", &a, 4);