Please use GitHub pull requests for new patches. Avoid migrating existing patches. Phabricator shutdown timeline
Changeset View
Changeset View
Standalone View
Standalone View
clang/unittests/Lex/HeaderSearchTest.cpp
Show First 20 Lines • Show All 182 Lines • ▼ Show 20 Lines | |||||
TEST_F(HeaderSearchTest, HeaderMapFrameworkLookup) { | TEST_F(HeaderSearchTest, HeaderMapFrameworkLookup) { | ||||
typedef NullTerminatedFile<test::HMapFileMock<4, 128>, char> FileTy; | typedef NullTerminatedFile<test::HMapFileMock<4, 128>, char> FileTy; | ||||
FileTy File; | FileTy File; | ||||
File.init(); | File.init(); | ||||
std::string HeaderDirName = "/tmp/Sources/Foo/Headers/"; | std::string HeaderDirName = "/tmp/Sources/Foo/Headers/"; | ||||
std::string HeaderName = "Foo.h"; | std::string HeaderName = "Foo.h"; | ||||
#ifdef _WIN32 | if (is_style_windows(llvm::sys::path::Style::native)) { | ||||
// Force header path to be absolute on windows. | // Force header path to be absolute on windows. | ||||
// As headermap content should represent absolute locations. | // As headermap content should represent absolute locations. | ||||
HeaderDirName = "C:" + HeaderDirName; | HeaderDirName = "C:" + HeaderDirName; | ||||
#endif /*_WIN32*/ | } | ||||
test::HMapFileMockMaker<FileTy> Maker(File); | test::HMapFileMockMaker<FileTy> Maker(File); | ||||
auto a = Maker.addString("Foo/Foo.h"); | auto a = Maker.addString("Foo/Foo.h"); | ||||
auto b = Maker.addString(HeaderDirName); | auto b = Maker.addString(HeaderDirName); | ||||
auto c = Maker.addString(HeaderName); | auto c = Maker.addString(HeaderName); | ||||
Maker.addBucket("Foo/Foo.h", a, b, c); | Maker.addBucket("Foo/Foo.h", a, b, c); | ||||
addHeaderMap("product-headers.hmap", File.getBuffer(), /*isAngled=*/true); | addHeaderMap("product-headers.hmap", File.getBuffer(), /*isAngled=*/true); | ||||
Show All 25 Lines |