[include-fixer] disable path cleaning test for windows and mingw.

llvm-svn: 271321
This commit is contained in:
Eric Liu 2016-05-31 19:22:01 +00:00
parent ef7347994e
commit 74ccbd61af
1 changed files with 8 additions and 5 deletions

View File

@ -90,8 +90,13 @@ public:
InMemoryFileSystem->addFile(HeaderName, 0,
llvm::MemoryBuffer::getMemBuffer(Code));
std::string Content = "#include\"" + std::string(HeaderName) +
"\"\n"
"#include \"internal/internal.h\"";
#if !defined(_MSC_VER) && !defined(__MINGW32__)
// Test path cleaning for both decls and macros.
const std::string DirtyHeader = "./internal/../internal/./a/b.h";
Content += "\n#include \"" + DirtyHeader + "\"";
const std::string CleanHeader = "internal/a/b.h";
const std::string DirtyHeaderContent =
"#define INTERNAL 1\nclass ExtraInternal {};";
@ -101,17 +106,15 @@ public:
CleanHeader, 1, {});
SymbolInfo DirtySymbol("ExtraInternal", SymbolInfo::SymbolKind::Class,
CleanHeader, 2, {});
std::string Content = "#include\"" + std::string(HeaderName) +
"\"\n"
"#include \"internal/internal.h\"\n"
"#include \"" + DirtyHeader + "\"";
#endif // _MSC_VER && __MINGW32__
InMemoryFileSystem->addFile(FileName, 0,
llvm::MemoryBuffer::getMemBuffer(Content));
Invocation.run();
EXPECT_TRUE(hasSymbol(InternalSymbol));
#if !defined(_MSC_VER) && !defined(__MINGW32__)
EXPECT_TRUE(hasSymbol(DirtySymbol));
EXPECT_TRUE(hasSymbol(DirtyMacro));
#endif // _MSC_VER && __MINGW32__
return true;
}