[clang-move] Fix unit tests with forward slash as separator on windows

Also remove a comment that seems to be left behind.

Differential Revision: https://reviews.llvm.org/D113269
This commit is contained in:
Martin Storsjö 2021-10-08 13:30:36 +00:00
parent 2ca6fc34fc
commit 98f0bf74ca
1 changed files with 4 additions and 3 deletions

View File

@ -208,7 +208,9 @@ runClangMoveOnCode(const move::MoveDefinitionSpec &Spec,
DeclarationReporter *const Reporter = nullptr) {
clang::RewriterTestContext Context;
Context.InMemoryFileSystem->setCurrentWorkingDirectory(WorkingDir);
llvm::SmallString<16> Dir(WorkingDir);
llvm::sys::path::native(Dir);
Context.InMemoryFileSystem->setCurrentWorkingDirectory(Dir);
std::map<llvm::StringRef, clang::FileID> FileToFileID;
@ -224,13 +226,12 @@ runClangMoveOnCode(const move::MoveDefinitionSpec &Spec,
CreateFiles(TestCCName, CC);
std::map<std::string, tooling::Replacements> FileToReplacements;
ClangMoveContext MoveContext = {Spec, FileToReplacements, WorkingDir, "LLVM",
ClangMoveContext MoveContext = {Spec, FileToReplacements, Dir.c_str(), "LLVM",
Reporter != nullptr};
auto Factory = std::make_unique<clang::move::ClangMoveActionFactory>(
&MoveContext, Reporter);
// std::string IncludeArg = Twine("-I" + WorkingDir;
tooling::runToolOnCodeWithArgs(
Factory->create(), CC, Context.InMemoryFileSystem,
{"-std=c++11", "-fparse-all-comments", "-I."}, TestCCName, "clang-move",