//===-- FileSpecListTest.cpp ----------------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// #include "gtest/gtest.h" #include "MockSymlinkFileSystem.h" #include "lldb/Utility/FileSpecList.h" #include "lldb/Utility/RealpathPrefixes.h" usingnamespacelldb_private; static FileSpec PosixSpec(llvm::StringRef path) { … } static FileSpec WindowsSpec(llvm::StringRef path) { … } TEST(SupportFileListTest, RelativePathMatchesPosix) { … } TEST(SupportFileListTest, RelativePathMatchesWindows) { … } // Support file is a symlink to the breakpoint file. // Absolute paths are used. // A matching prefix is set. // Should find it compatible. TEST(SupportFileListTest, SymlinkedAbsolutePaths) { … } // Support file is a symlink to the breakpoint file. // Absolute paths are used. // A matching prefix is set, which is the root directory. // Should find it compatible. TEST(SupportFileListTest, RootDirectory) { … } // Support file is a symlink to the breakpoint file. // Relative paths are used. // A matching prefix is set. // Should find it compatible. TEST(SupportFileListTest, SymlinkedRelativePaths) { … } // Support file is a symlink to the breakpoint file. // A matching prefix is set. // Input file only match basename and not directory. // Should find it incompatible. TEST(SupportFileListTest, RealpathOnlyMatchFileName) { … } // Support file is a symlink to the breakpoint file. // A prefix is set, which is a matching string prefix, but not a path prefix. // Should find it incompatible. TEST(SupportFileListTest, DirectoryMatchStringPrefixButNotWholeDirectoryName) { … } // Support file is a symlink to the breakpoint file. // A matching prefix is set. // However, the breakpoint is set with a partial path. // Should find it compatible. TEST(SupportFileListTest, PartialBreakpointPath) { … } // Support file is a symlink to the breakpoint file. // A matching prefix is set. // However, the basename is different between the symlink and its target. // Should find it incompatible. TEST(SupportFileListTest, DifferentBasename) { … } // No prefixes are configured. // The support file and the breakpoint file are different. // Should find it incompatible. TEST(SupportFileListTest, NoPrefixes) { … } // No prefixes are configured. // The support file and the breakpoint file are the same. // Should find it compatible. TEST(SupportFileListTest, SameFile) { … }