[llvm][Windows] Don't run socket tests on old versions of Windows
AF_UNIX sockets were added to Windows 10 build 17063 in 2017, older versions of Windows will fail this test. Also add a lit config so lit tests using sockets can do: // REQUIRES: unix-sockets (It would be cool if unit tests could use lit available_features) Also fix llvm-config test that didn't fail when new libs are added.
This commit is contained in:
1 parent
de8ee03ed9
commit
d7aee33029
3 files changed
+20
-1
No files matched your search
@@ -572,6 +572,9 @@ if "darwin" == sys.platform:
|
||||
if "hw.optional.fma: 1" in result:
|
||||
config.available_features.add("fma3")
|
||||
|
||||
if not hasattr(sys, "getwindowsversion") or sys.getwindowsversion().build >= 17063:
|
||||
config.available_features.add("unix-sockets")
|
||||
|
||||
# .debug_frame is not emitted for targeting Windows x64, aarch64/arm64, AIX, or Apple Silicon Mac.
|
||||
if not re.match(
|
||||
r"^(x86_64|aarch64|arm64|powerpc|powerpc64).*-(windows-gnu|windows-msvc|aix)",
|
||||
|
||||
@@ -2,6 +2,6 @@ RUN: llvm-config --link-static --system-libs Support 2>&1 | FileCheck %s
|
||||
REQUIRES: static-libs
|
||||
REQUIRES: host={{.*-windows-msvc}}
|
||||
CHECK-NOT: -l
|
||||
CHECK: psapi.lib shell32.lib ole32.lib uuid.lib advapi32.lib
|
||||
CHECK: psapi.lib shell32.lib ole32.lib uuid.lib advapi32.lib Ws2_32.lib{{$}}
|
||||
CHECK-NOT: error
|
||||
CHECK-NOT: warning
|
||||
@@ -10,11 +10,27 @@
|
||||
#include <iostream>
|
||||
#include <stdlib.h>
|
||||
|
||||
#ifdef _WIN32
|
||||
#include "llvm/Support/Windows/WindowsSupport.h"
|
||||
#endif
|
||||
|
||||
using namespace llvm;
|
||||
|
||||
namespace {
|
||||
|
||||
bool hasUnixSocketSupport() {
|
||||
#ifdef _WIN32
|
||||
VersionTuple Ver = GetWindowsOSVersion();
|
||||
if (Ver < VersionTuple(10, 0, 0, 17063))
|
||||
return false;
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
|
||||
TEST(raw_socket_streamTest, CLIENT_TO_SERVER_AND_SERVER_TO_CLIENT) {
|
||||
if (!hasUnixSocketSupport())
|
||||
GTEST_SKIP();
|
||||
|
||||
SmallString<100> SocketPath;
|
||||
llvm::sys::fs::createUniquePath("test_raw_socket_stream.sock", SocketPath,
|
||||
true);
|
||||
|
||||
Reference in new issue
Block a user