Author: hokein Date: Tue Apr 17 01:34:50 2018 New Revision: 330182 URL: http://llvm.org/viewvc/llvm-project?rev=330182&view=rev Log: [clangd] Fix "fail to create file URI" warnings in FileIndexTest.
Summary: When running the FileIndexTest, it shows "Failed to create an URI for file XXX: not a valid absolute file path" warnings, and the generated Symbols is missing Location information. Reviewers: ioeric Subscribers: klimek, ilya-biryukov, jkorous-apple, MaskRay, cfe-commits Differential Revision: https://reviews.llvm.org/D45692 Modified: clang-tools-extra/trunk/unittests/clangd/FileIndexTests.cpp Modified: clang-tools-extra/trunk/unittests/clangd/FileIndexTests.cpp URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/unittests/clangd/FileIndexTests.cpp?rev=330182&r1=330181&r2=330182&view=diff ============================================================================== --- clang-tools-extra/trunk/unittests/clangd/FileIndexTests.cpp (original) +++ clang-tools-extra/trunk/unittests/clangd/FileIndexTests.cpp Tue Apr 17 01:34:50 2018 @@ -94,8 +94,8 @@ llvm::Optional<ParsedAST> build(llvm::St "BasePath must be a base file path without extension."); llvm::IntrusiveRefCntPtr<vfs::InMemoryFileSystem> VFS( new vfs::InMemoryFileSystem); - std::string Path = (BasePath + ".cpp").str(); - std::string Header = (BasePath + ".h").str(); + std::string Path = testPath((BasePath + ".cpp").str()); + std::string Header = testPath((BasePath + ".h").str()); VFS->addFile(Path, 0, llvm::MemoryBuffer::getMemBuffer("")); VFS->addFile(Header, 0, llvm::MemoryBuffer::getMemBuffer(Code)); const char *Args[] = {"clang", "-xc++", "-include", Header.c_str(), _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits