[clang-tools-extra] r354453 - [clangd] Revert r354442 and r354444

Kadir Cetinkaya via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 20 03:45:20 PST 2019


Author: kadircet
Date: Wed Feb 20 03:45:20 2019
New Revision: 354453

URL: http://llvm.org/viewvc/llvm-project?rev=354453&view=rev
Log:
[clangd] Revert r354442 and r354444

Looks like sysroot is only working on linux.

Modified:
    clang-tools-extra/trunk/unittests/clangd/XRefsTests.cpp

Modified: clang-tools-extra/trunk/unittests/clangd/XRefsTests.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/unittests/clangd/XRefsTests.cpp?rev=354453&r1=354452&r2=354453&view=diff
==============================================================================
--- clang-tools-extra/trunk/unittests/clangd/XRefsTests.cpp (original)
+++ clang-tools-extra/trunk/unittests/clangd/XRefsTests.cpp Wed Feb 20 03:45:20 2019
@@ -1441,40 +1441,6 @@ TEST(FindReferences, NoQueryForLocalSymb
   }
 }
 
-TEST(GoTo, WithSysRoot) {
-#ifdef _WIN32
-  const char *CustomRoot = "C:\\sys\\root\\";
-#else
-  const char *CustomRoot = "/sys/root/";
-#endif
-  Annotations Main(R"cpp(
-      #include "header.h"
-      int main() {
-        return f^oo();
-      })cpp");
-  Annotations Header("int [[foo]](){return 42;}");
-
-  MockCompilationDatabase CDB;
-  CDB.ExtraClangFlags = {"--sysroot", CustomRoot};
-  IgnoreDiagnostics DiagConsumer;
-  MockFSProvider FS;
-  ClangdServer Server(CDB, FS, DiagConsumer, ClangdServer::optsForTest());
-
-  // Fill the filesystem.
-  auto FooCpp = testPath("foo.cpp");
-  FS.Files[FooCpp] = Main.code();
-  llvm::SmallString<128> HeaderPath(CustomRoot);
-  llvm::sys::path::append(HeaderPath, "include", "header.h");
-  FS.Files[HeaderPath] = Header.code();
-
-  runAddDocument(Server, FooCpp, Main.code());
-
-  // Go to a definition in main source file.
-  auto Locations = runLocateSymbolAt(Server, FooCpp, Main.point());
-  EXPECT_TRUE(bool(Locations)) << "findDefinitions returned an error";
-  EXPECT_THAT(*Locations, ElementsAre(Sym("foo", Header.range())));
-}
-
 } // namespace
 } // namespace clangd
 } // namespace clang




More information about the cfe-commits mailing list