diff options
Diffstat (limited to 'unittests/Platform/PlatformDarwinTest.cpp')
| -rw-r--r-- | unittests/Platform/PlatformDarwinTest.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/unittests/Platform/PlatformDarwinTest.cpp b/unittests/Platform/PlatformDarwinTest.cpp index 18cd1b76997e..a388f413ff5e 100644 --- a/unittests/Platform/PlatformDarwinTest.cpp +++ b/unittests/Platform/PlatformDarwinTest.cpp @@ -18,6 +18,13 @@ using namespace lldb; using namespace lldb_private; +struct PlatformDarwinTester : public PlatformDarwin { + static bool SDKSupportsModules(SDKType desired_type, + const lldb_private::FileSpec &sdk_path) { + return PlatformDarwin::SDKSupportsModules(desired_type, sdk_path); + } +}; + TEST(PlatformDarwinTest, TestParseVersionBuildDir) { llvm::VersionTuple V; llvm::StringRef D; @@ -44,4 +51,22 @@ TEST(PlatformDarwinTest, TestParseVersionBuildDir) { std::tie(V, D) = PlatformDarwin::ParseVersionBuildDir("3.4.5"); EXPECT_EQ(llvm::VersionTuple(3, 4, 5), V); + + std::string base = "/Applications/Xcode.app/Contents/Developer/Platforms/"; + EXPECT_TRUE(PlatformDarwinTester::SDKSupportsModules( + PlatformDarwin::SDKType::iPhoneSimulator, + FileSpec( + base + + "iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk"))); + EXPECT_FALSE(PlatformDarwinTester::SDKSupportsModules( + PlatformDarwin::SDKType::iPhoneSimulator, + FileSpec( + base + + "iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.2.sdk"))); + EXPECT_TRUE(PlatformDarwinTester::SDKSupportsModules( + PlatformDarwin::SDKType::MacOSX, + FileSpec(base + "MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk"))); + EXPECT_FALSE(PlatformDarwinTester::SDKSupportsModules( + PlatformDarwin::SDKType::MacOSX, + FileSpec(base + "MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk"))); } |
