Skip to content

Commit c953e85

Browse files
etrclaude
andcommitted
Fix CI: gate pipe_body tests on !_WIN32
MSYS2/mingw does not expose POSIX ::pipe(); Windows uses _pipe() or CreatePipe(). The pipe_body class itself is portable (it just owns and closes an existing fd), but the unit tests need to *create* a pipe to exercise it, which is platform-specific. Gating the two pipe-creating tests with #ifndef _WIN32 keeps the test on Linux/macOS where the class's behaviour is exercised by the rest of the matrix. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 13aa17a commit c953e85

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

test/unit/body_test.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,14 @@ LT_END_AUTO_TEST(iovec_body_empty_entries_materializes)
198198

199199
// -----------------------------------------------------------------------
200200
// pipe_body
201+
//
202+
// Gated on !_WIN32: MSYS2/mingw does not expose POSIX ::pipe() — Windows
203+
// pipes use _pipe() / CreatePipe(). The pipe_body class itself is portable
204+
// (it just owns and closes a fd) but the tests below need to *create* a
205+
// pipe to exercise it, which is platform-specific. The Linux/macOS CI
206+
// matrix exercises this code path.
201207
// -----------------------------------------------------------------------
208+
#ifndef _WIN32
202209
LT_BEGIN_AUTO_TEST(body_suite, pipe_body_kind_and_materialize)
203210
int fds[2];
204211
int rc = ::pipe(fds);
@@ -227,6 +234,7 @@ LT_BEGIN_AUTO_TEST(body_suite, pipe_body_destructor_closes_fd_when_not_materiali
227234
LT_CHECK_EQ(errno, EBADF);
228235
::close(fds[1]);
229236
LT_END_AUTO_TEST(pipe_body_destructor_closes_fd_when_not_materialized)
237+
#endif // !_WIN32
230238

231239
// -----------------------------------------------------------------------
232240
// deferred_body

0 commit comments

Comments
 (0)