#include "clang/Lex/HeaderSearch.h"
#include "HeaderMapTestUtils.h"
#include "clang/Basic/Diagnostic.h"
#include "clang/Basic/DiagnosticOptions.h"
#include "clang/Basic/FileManager.h"
#include "clang/Basic/LangOptions.h"
#include "clang/Basic/SourceManager.h"
#include "clang/Basic/TargetInfo.h"
#include "clang/Basic/TargetOptions.h"
#include "clang/Lex/HeaderSearchOptions.h"
#include "clang/Serialization/InMemoryModuleCache.h"
#include "llvm/Support/MemoryBuffer.h"
#include "gtest/gtest.h"
#include <memory>
#include <string>
namespace clang {
namespace {
class HeaderSearchTest : public ::testing::Test { … };
TEST_F(HeaderSearchTest, NoSearchDir) { … }
TEST_F(HeaderSearchTest, SimpleShorten) { … }
TEST_F(HeaderSearchTest, ShortenWithWorkingDir) { … }
TEST_F(HeaderSearchTest, Dots) { … }
TEST_F(HeaderSearchTest, RelativeDirs) { … }
#ifdef _WIN32
TEST_F(HeaderSearchTest, BackSlash) {
addSearchDir("C:\\x\\y\\");
EXPECT_EQ(Search.suggestPathToFileForDiagnostics("C:\\x\\y\\z\\t",
"",
""),
"z/t");
}
TEST_F(HeaderSearchTest, BackSlashWithDotDot) {
addSearchDir("..\\y");
EXPECT_EQ(Search.suggestPathToFileForDiagnostics("C:\\x\\y\\z\\t",
"C:/x/y/",
""),
"z/t");
}
#endif
TEST_F(HeaderSearchTest, DotDotsWithAbsPath) { … }
TEST_F(HeaderSearchTest, BothDotDots) { … }
TEST_F(HeaderSearchTest, IncludeFromSameDirectory) { … }
TEST_F(HeaderSearchTest, SdkFramework) { … }
TEST_F(HeaderSearchTest, NestedFramework) { … }
TEST_F(HeaderSearchTest, HeaderFrameworkLookup) { … }
template <class FileTy, class PaddingTy>
struct NullTerminatedFile : public FileTy { … };
TEST_F(HeaderSearchTest, HeaderMapReverseLookup) { … }
TEST_F(HeaderSearchTest, HeaderMapFrameworkLookup) { … }
TEST_F(HeaderSearchTest, HeaderFileInfoMerge) { … }
}
}