[clang-tools-extra] r354444 - [clangd] Try to fix windows build bots

Kadir Cetinkaya via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 20 02:32:04 PST 2019


Author: kadircet
Date: Wed Feb 20 02:32:04 2019
New Revision: 354444

URL: http://llvm.org/viewvc/llvm-project?rev=354444&view=rev
Log:
[clangd] Try to fix windows build bots

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=354444&r1=354443&r2=354444&view=diff
==============================================================================
--- clang-tools-extra/trunk/unittests/clangd/XRefsTests.cpp (original)
+++ clang-tools-extra/trunk/unittests/clangd/XRefsTests.cpp Wed Feb 20 02:32:04 2019
@@ -1442,7 +1442,11 @@ TEST(FindReferences, NoQueryForLocalSymb
 }
 
 TEST(GoTo, WithSysRoot) {
-  const char *CustoomRoot = "/sys/root/";
+#ifdef _WIN32
+  const char *CustomRoot = "C:\\sys\\root\\";
+#else
+  const char *CustomRoot = "/sys/root/";
+#endif
   Annotations Main(R"cpp(
       #include "header.h"
       int main() {
@@ -1451,7 +1455,7 @@ TEST(GoTo, WithSysRoot) {
   Annotations Header("int [[foo]](){return 42;}");
 
   MockCompilationDatabase CDB;
-  CDB.ExtraClangFlags = {"--sysroot", CustoomRoot};
+  CDB.ExtraClangFlags = {"--sysroot", CustomRoot};
   IgnoreDiagnostics DiagConsumer;
   MockFSProvider FS;
   ClangdServer Server(CDB, FS, DiagConsumer, ClangdServer::optsForTest());
@@ -1459,7 +1463,8 @@ TEST(GoTo, WithSysRoot) {
   // Fill the filesystem.
   auto FooCpp = testPath("foo.cpp");
   FS.Files[FooCpp] = Main.code();
-  auto HeaderPath = (llvm::StringRef(CustoomRoot) + "include/header.h").str();
+  llvm::SmallString<128> HeaderPath(CustomRoot);
+  llvm::sys::path::append(HeaderPath, "include", "header.h");
   FS.Files[HeaderPath] = Header.code();
 
   runAddDocument(Server, FooCpp, Main.code());




More information about the cfe-commits mailing list