From 98f0bf74ca6d7aa9b3c2b240693824f085aa6675 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Fri, 8 Oct 2021 13:30:36 +0000 Subject: [PATCH] [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 --- clang-tools-extra/unittests/clang-move/ClangMoveTests.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/clang-tools-extra/unittests/clang-move/ClangMoveTests.cpp b/clang-tools-extra/unittests/clang-move/ClangMoveTests.cpp index b9553e111a57..082779358fbf 100644 --- a/clang-tools-extra/unittests/clang-move/ClangMoveTests.cpp +++ b/clang-tools-extra/unittests/clang-move/ClangMoveTests.cpp @@ -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 FileToFileID; @@ -224,13 +226,12 @@ runClangMoveOnCode(const move::MoveDefinitionSpec &Spec, CreateFiles(TestCCName, CC); std::map FileToReplacements; - ClangMoveContext MoveContext = {Spec, FileToReplacements, WorkingDir, "LLVM", + ClangMoveContext MoveContext = {Spec, FileToReplacements, Dir.c_str(), "LLVM", Reporter != nullptr}; auto Factory = std::make_unique( &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",