diff options
| author | Jonas Devlieghere <jonas@devlieghere.com> | 2019-09-24 19:34:50 +0000 |
|---|---|---|
| committer | Jonas Devlieghere <jonas@devlieghere.com> | 2019-09-24 19:34:50 +0000 |
| commit | 7de14dc3c60593569a93aba75e22f0085d2d3b04 (patch) | |
| tree | 006be538d57313d0bebee2bfc82fbd2c162327cd /lldb | |
| parent | 1282889347d599a0420c46642ad5f49304a09e7e (diff) | |
| download | bcm5719-llvm-7de14dc3c60593569a93aba75e22f0085d2d3b04.tar.gz bcm5719-llvm-7de14dc3c60593569a93aba75e22f0085d2d3b04.zip | |
[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
llvm-svn: 372774
Diffstat (limited to 'lldb')
| -rw-r--r-- | lldb/unittests/Host/SocketTest.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/lldb/unittests/Host/SocketTest.cpp b/lldb/unittests/Host/SocketTest.cpp index 4e897975e5d..9408ecdaabe 100644 --- a/lldb/unittests/Host/SocketTest.cpp +++ b/lldb/unittests/Host/SocketTest.cpp @@ -93,8 +93,10 @@ TEST_F(SocketTest, DomainListenConnectAccept) { 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; |

