zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit 9bd82fd51ee77a4033d726f3ade94c7964f5beed (tree)
parent 6fe487bca2b69c16be2db78ef075470ef60fb1ec
Author: Alex Rønne Petersen <alex@alexrp.com>
Date:   Mon,  1 Jun 2026 10:35:16 +0200

test/c: disable some tests on *-windows-msvc when the symbols don't exist

closes https://codeberg.org/ziglang/zig/issues/35517

Diffstat:
Mtest/c/math.zig | 3+++
Mtest/c/pthread.zig | 1+
Mtest/c/strings.zig | 4++++
Mtest/tests.zig | 6------
4 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/test/c/math.zig b/test/c/math.zig @@ -61,10 +61,13 @@ test "modf" { } test "modff" { + if (builtin.cpu.arch == .x86 and builtin.target.os.tag == .windows and builtin.target.abi != .gnu) return; // mingw-only + try testModf(f32); } test "modfl" { + if (builtin.cpu.arch.isX86() and builtin.target.os.tag == .windows and builtin.target.abi != .gnu) return; // mingw-only if (builtin.target.cpu.arch.isPowerPC()) return error.SkipZigTest; // TODO: see https://codeberg.org/ziglang/zig/issues/30976 try testModf(c_longdouble); diff --git a/test/c/pthread.zig b/test/c/pthread.zig @@ -7,6 +7,7 @@ const testing = std.testing; test "pthread_spinlock_t" { if (builtin.target.os.tag.isDarwin()) return; // Darwin doesn't have `pthread_spin_*` + if (builtin.target.os.tag == .windows and builtin.target.abi != .gnu) return; // winpthreads-only var spin: c.pthread_spinlock_t = undefined; _ = c.pthread_spin_init(&spin, c.PTHREAD_PROCESS_PRIVATE); diff --git a/test/c/strings.zig b/test/c/strings.zig @@ -48,6 +48,8 @@ test "ffs" { } test "strcasecmp" { + if (builtin.target.os.tag == .windows and builtin.target.abi != .gnu) return; // mingw-only + try testing.expect(c.strcasecmp(@ptrCast("a"), @ptrCast("b")) < 0); try testing.expect(c.strcasecmp(@ptrCast("b"), @ptrCast("a")) > 0); try testing.expect(c.strcasecmp(@ptrCast("A"), @ptrCast("b")) < 0); @@ -58,6 +60,8 @@ test "strcasecmp" { } test "strncasecmp" { + if (builtin.target.os.tag == .windows and builtin.target.abi != .gnu) return; // mingw-only + try testing.expect(c.strncasecmp(@ptrCast("a"), @ptrCast("b"), 1) < 0); try testing.expect(c.strncasecmp(@ptrCast("b"), @ptrCast("a"), 1) > 0); try testing.expect(c.strncasecmp(@ptrCast("A"), @ptrCast("b"), 1) < 0); diff --git a/test/tests.zig b/test/tests.zig @@ -1611,8 +1611,6 @@ const module_test_targets = blk: { .abi = .msvc, }, .link_libc = true, - // https://codeberg.org/ziglang/zig/issues/35517 - .skip_modules = &.{"libc"}, }, .{ .target = .{ @@ -1628,8 +1626,6 @@ const module_test_targets = blk: { .abi = .gnu, }, .link_libc = true, - // https://codeberg.org/ziglang/zig/issues/35517 - .skip_modules = &.{"libc"}, }, .{ @@ -1657,8 +1653,6 @@ const module_test_targets = blk: { .abi = .msvc, }, .link_libc = true, - // https://codeberg.org/ziglang/zig/issues/35517 - .skip_modules = &.{"libc"}, }, .{ .target = .{