Empty out all tests if GRPC_POSIX_SOCKET is not defined

pull/14397/head
Vijay Pai 7 years ago
parent 132efa0c9b
commit dd57cb5949
  1. 9
      test/cpp/end2end/nonblocking_test.cc

@ -33,15 +33,15 @@
#ifdef GRPC_POSIX_SOCKET #ifdef GRPC_POSIX_SOCKET
#include "src/core/lib/iomgr/ev_posix.h" #include "src/core/lib/iomgr/ev_posix.h"
#endif #endif // GRPC_POSIX_SOCKET
#include <gtest/gtest.h> #include <gtest/gtest.h>
#ifdef GRPC_POSIX_SOCKET
// Thread-local variable to so that only polls from this test assert // Thread-local variable to so that only polls from this test assert
// non-blocking (not polls from resolver, timer thread, etc) // non-blocking (not polls from resolver, timer thread, etc)
GPR_TLS_DECL(g_is_nonblocking_test); GPR_TLS_DECL(g_is_nonblocking_test);
#ifdef GRPC_POSIX_SOCKET
namespace { namespace {
int maybe_assert_non_blocking_poll(struct pollfd* pfds, nfds_t nfds, int maybe_assert_non_blocking_poll(struct pollfd* pfds, nfds_t nfds,
@ -53,7 +53,6 @@ int maybe_assert_non_blocking_poll(struct pollfd* pfds, nfds_t nfds,
} }
} // namespace } // namespace
#endif
namespace grpc { namespace grpc {
namespace testing { namespace testing {
@ -180,11 +179,13 @@ TEST_F(NonblockingTest, SimpleRpc) {
} // namespace testing } // namespace testing
} // namespace grpc } // namespace grpc
#endif // GRPC_POSIX_SOCKET
int main(int argc, char** argv) { int main(int argc, char** argv) {
#ifdef GRPC_POSIX_SOCKET #ifdef GRPC_POSIX_SOCKET
// Override the poll function before anything else can happen // Override the poll function before anything else can happen
grpc_poll_function = maybe_assert_non_blocking_poll; grpc_poll_function = maybe_assert_non_blocking_poll;
#endif #endif // GRPC_POSIX_SOCKET
grpc_test_init(argc, argv); grpc_test_init(argc, argv);
::testing::InitGoogleTest(&argc, argv); ::testing::InitGoogleTest(&argc, argv);

Loading…
Cancel
Save