Skip to content

Commit 98f0bf7

Browse files
committed
[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
1 parent 2ca6fc3 commit 98f0bf7

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

clang-tools-extra/unittests/clang-move/ClangMoveTests.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,9 @@ runClangMoveOnCode(const move::MoveDefinitionSpec &Spec,
208208
DeclarationReporter *const Reporter = nullptr) {
209209
clang::RewriterTestContext Context;
210210

211-
Context.InMemoryFileSystem->setCurrentWorkingDirectory(WorkingDir);
211+
llvm::SmallString<16> Dir(WorkingDir);
212+
llvm::sys::path::native(Dir);
213+
Context.InMemoryFileSystem->setCurrentWorkingDirectory(Dir);
212214

213215
std::map<llvm::StringRef, clang::FileID> FileToFileID;
214216

@@ -224,13 +226,12 @@ runClangMoveOnCode(const move::MoveDefinitionSpec &Spec,
224226
CreateFiles(TestCCName, CC);
225227

226228
std::map<std::string, tooling::Replacements> FileToReplacements;
227-
ClangMoveContext MoveContext = {Spec, FileToReplacements, WorkingDir, "LLVM",
229+
ClangMoveContext MoveContext = {Spec, FileToReplacements, Dir.c_str(), "LLVM",
228230
Reporter != nullptr};
229231

230232
auto Factory = std::make_unique<clang::move::ClangMoveActionFactory>(
231233
&MoveContext, Reporter);
232234

233-
// std::string IncludeArg = Twine("-I" + WorkingDir;
234235
tooling::runToolOnCodeWithArgs(
235236
Factory->create(), CC, Context.InMemoryFileSystem,
236237
{"-std=c++11", "-fparse-all-comments", "-I."}, TestCCName, "clang-move",

0 commit comments

Comments
 (0)