Skip to content

Commit ca7b59d

Browse files
committed
Keep the Windows target from being an empty test binary
Every case here drives a POSIX socketpair and sits inside #ifndef _WIN32, so the Windows build contained no tests and passed with nothing run. open-telemetry#4294 hit the same thing and solved it this way, so this follows it: one case declared on every platform, which also gives gtest_add_tests, which scans the source, a name the binary contains everywhere.
1 parent 0d9a586 commit ca7b59d

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

‎ext/test/http/http_server_test.cc‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,3 +193,17 @@ TEST(HttpServer100ContinueTest, CompletedInterimResponseRestoresReadInterest)
193193
} // namespace
194194

195195
#endif // _WIN32
196+
197+
// The cases above drive POSIX socketpairs, so the Windows build of this target would otherwise
198+
// contain no tests at all and pass vacuously. This one is declared on every platform to keep the
199+
// binary non-empty and to give gtest_add_tests, which scans the source, a case the binary
200+
// contains everywhere.
201+
TEST(HttpServerNonBlockingIo, NotApplicableOnWindows)
202+
{
203+
#ifdef _WIN32
204+
GTEST_SKIP() << "the would-block paths are driven with a POSIX socketpair";
205+
#else
206+
GTEST_SKIP() << "covered by the HttpServerSendMoreTest, HttpServerReadableTest and "
207+
"HttpServer100ContinueTest cases above";
208+
#endif
209+
}

0 commit comments

Comments
 (0)