1 //===- llvm/unittest/DWARFLinkerParallel/DWARFLinkerTest.cpp --------------===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 #include "llvm/DWARFLinker/Utils.h"
10 #include "gtest/gtest.h"
13 using namespace dwarf_linker
;
15 #define DEVELOPER_DIR "/Applications/Xcode.app/Contents/Developer"
19 TEST(DWARFLinker
, PathTest
) {
20 EXPECT_EQ(guessDeveloperDir("/Foo"), "");
21 EXPECT_EQ(guessDeveloperDir("Foo.sdk"), "");
22 EXPECT_EQ(guessDeveloperDir(
24 "/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.4.sdk"),
26 EXPECT_EQ(guessDeveloperDir(DEVELOPER_DIR
"/SDKs/MacOSX.sdk"), DEVELOPER_DIR
);
28 isInToolchainDir("/Library/Developer/Toolchains/"
29 "swift-DEVELOPMENT-SNAPSHOT-2024-05-15-a.xctoolchain/"
30 "usr/lib/swift/macosx/_StringProcessing.swiftmodule/"
31 "arm64-apple-macos.private.swiftinterface"));
32 EXPECT_FALSE(isInToolchainDir("/Foo/not-an.xctoolchain/Bar/Baz"));
35 } // anonymous namespace