[Lldb-commits] [lldb] r372774 - [unittest] Skip the socket tests if we $TMPDIR is too long.
Jonas Devlieghere via lldb-commits
lldb-commits at lists.llvm.org
Tue Sep 24 12:34:50 PDT 2019
Author: jdevlieghere
Date: Tue Sep 24 12:34:50 2019
New Revision: 372774
URL: http://llvm.org/viewvc/llvm-project?rev=372774&view=rev
Log:
[unittest] Skip the socket tests if we $TMPDIR is too long.
Adrian added a sanity check to the socket tests to ensure the $TMPDIR is
not too long for a socket. While this is great for diagnosing the
problem it doesn't really solve the problem for environment where you
have no control over that variable such as in CI. I propose to just skip
the test in that case similar to what we do for tests that rely on
targets that are not currently build, etc.
Differential revision: https://reviews.llvm.org/D67972
Modified:
lldb/trunk/unittests/Host/SocketTest.cpp
Modified: lldb/trunk/unittests/Host/SocketTest.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/Host/SocketTest.cpp?rev=372774&r1=372773&r2=372774&view=diff
==============================================================================
--- lldb/trunk/unittests/Host/SocketTest.cpp (original)
+++ lldb/trunk/unittests/Host/SocketTest.cpp Tue Sep 24 12:34:50 2019
@@ -93,8 +93,10 @@ TEST_F(SocketTest, DomainListenConnectAc
std::error_code EC = llvm::sys::fs::createUniqueDirectory("DomainListenConnectAccept", Path);
ASSERT_FALSE(EC);
llvm::sys::path::append(Path, "test");
- // If this fails, $TMPDIR is too long to hold a domain socket.
- EXPECT_LE(Path.size(), 107u);
+
+ // Skip the test if the $TMPDIR is too long to hold a domain socket.
+ if (Path.size() > 107u)
+ return;
std::unique_ptr<DomainSocket> socket_a_up;
std::unique_ptr<DomainSocket> socket_b_up;
@@ -196,8 +198,10 @@ TEST_F(SocketTest, DomainGetConnectURI)
llvm::sys::fs::createUniqueDirectory("DomainListenConnectAccept", domain_path);
ASSERT_FALSE(EC);
llvm::sys::path::append(domain_path, "test");
- // If this fails, $TMPDIR is too long to hold a domain socket.
- EXPECT_LE(domain_path.size(), 107u);
+
+ // Skip the test if the $TMPDIR is too long to hold a domain socket.
+ if (domain_path.size() > 107u)
+ return;
std::unique_ptr<DomainSocket> socket_a_up;
std::unique_ptr<DomainSocket> socket_b_up;
More information about the lldb-commits
mailing list