|
reference, declaration → definition
definition → references, declarations, derived classes, virtual overrides
reference to multiple definitions → definitions
unreferenced
|
Declarations
tools/clang/tools/extra/clangd/unittests/TestFS.h 68 std::string testPath(PathRef File);
References
tools/clang/tools/extra/clangd/unittests/BackgroundIndexTests.cpp 90 FS.Files[testPath("root/A.cc")] = "error file";
99 Cmd.Filename = testPath("root/A.cc");
100 Cmd.Directory = testPath("root");
101 Cmd.CommandLine = {"clang++", "-DA=1", testPath("root/A.cc")};
102 CDB.setCompileCommand(testPath("root/A.cc"), Cmd);
110 FS.Files[testPath("root/A.h")] = R"cpp(
119 FS.Files[testPath("root/A.cc")] =
121 FS.Files[testPath("root/B.cc")] =
139 Cmd.Filename = testPath("root/A.cc");
140 Cmd.Directory = testPath("root");
141 Cmd.CommandLine = {"clang++", "-DA=1", testPath("root/A.cc")};
142 CDB.setCompileCommand(testPath("root/A.cc"), Cmd);
152 Cmd.Filename = testPath("root/B.cc");
154 CDB.setCompileCommand(testPath("root/B.cc"), Cmd);
179 FS.Files[testPath("root/A.h")] = R"cpp(
185 FS.Files[testPath("root/A.cc")] = R"cpp(
196 Cmd.Filename = testPath("root/A.cc");
197 Cmd.Directory = testPath("root");
198 Cmd.CommandLine = {"clang++", testPath("root/A.cc")};
204 CDB.setCompileCommand(testPath("root/A.cc"), Cmd);
214 CDB.setCompileCommand(testPath("root/A.cc"), Cmd);
220 auto ShardHeader = MSS.loadShard(testPath("root/A.h"));
230 auto ShardSource = MSS.loadShard(testPath("root/A.cc"));
250 FS.Files[testPath("root/B.h")] = "";
251 FS.Files[testPath("root/A.h")] = R"cpp(
258 FS.Files[testPath("root/A.cc")] = A_CC;
265 Cmd.Filename = testPath("root/A.cc");
266 Cmd.Directory = testPath("root");
267 Cmd.CommandLine = {"clang++", testPath("root/A.cc")};
272 CDB.setCompileCommand(testPath("root/A.cc"), Cmd);
276 auto ShardSource = MSS.loadShard(testPath("root/A.cc"));
287 auto ShardHeader = MSS.loadShard(testPath("root/A.h"));
301 FS.Files[testPath("root/A.h")] = R"cpp(
306 FS.Files[testPath("root/A.cc")] =
314 Cmd.Filename = testPath("root/A.cc");
315 Cmd.Directory = testPath("root");
316 Cmd.CommandLine = {"clang++", testPath("root/A.cc")};
322 CDB.setCompileCommand(testPath("root/A.cc"), Cmd);
327 FS.Files[testPath("root/A.h")] = R"cpp(
337 CDB.setCompileCommand(testPath("root/A.cc"), Cmd);
343 auto ShardHeader = MSS.loadShard(testPath("root/A.h"));
348 FS.Files[testPath("root/A.cc")] =
355 CDB.setCompileCommand(testPath("root/A.cc"), Cmd);
361 ShardHeader = MSS.loadShard(testPath("root/A.h"));
364 auto ShardSource = MSS.loadShard(testPath("root/A.cc"));
372 FS.Files[testPath("root/A.h")] = R"cpp(
377 FS.Files[testPath("root/B.h")] = R"cpp(
380 FS.Files[testPath("root/A.cc")] =
388 Cmd.Filename = testPath("root/A.cc");
389 Cmd.Directory = testPath("root");
390 Cmd.CommandLine = {"clang++", testPath("root/A.cc")};
396 CDB.setCompileCommand(testPath("root/A.cc"), Cmd);
400 UnorderedElementsAre(testPath("root/A.cc"), testPath("root/A.h"),
400 UnorderedElementsAre(testPath("root/A.cc"), testPath("root/A.h"),
401 testPath("root/B.h")));
402 auto ShardHeader = MSS.loadShard(testPath("root/B.h"));
412 CDB.setCompileCommand(testPath("root/A.cc"), Cmd);
418 FS.Files[testPath("root/B.h")] = R"cpp(
428 CDB.setCompileCommand(testPath("root/A.cc"), Cmd);
432 ShardHeader = MSS.loadShard(testPath("root/B.h"));
448 FS.Files[testPath("root/A.cc")] = "";
450 Cmd.Directory = testPath("root/build");
452 CDB.setCompileCommand(testPath("root/build/../A.cc"), Cmd);
454 FS.Files[testPath("root/B.cc")] = "";
456 Cmd.Directory = testPath("root");
458 CDB.setCompileCommand(testPath("root/./B.cc"), Cmd);
477 FS.Files[testPath("A.h")] = "void foo();";
478 FS.Files[testPath("B.h")] = "#include \"C.h\"\nasdf;";
479 FS.Files[testPath("C.h")] = "";
480 FS.Files[testPath("A.cc")] = R"cpp(
488 Cmd.Directory = testPath("build");
490 CDB.setCompileCommand(testPath("build/../A.cc"), Cmd);
493 EXPECT_THAT(Storage.keys(), ElementsAre(testPath("A.cc"), testPath("A.h"),
493 EXPECT_THAT(Storage.keys(), ElementsAre(testPath("A.cc"), testPath("A.h"),
494 testPath("B.h"), testPath("C.h")));
494 testPath("B.h"), testPath("C.h")));
497 auto Shard = MSS.loadShard(testPath("A.cc"));
506 auto Shard = MSS.loadShard(testPath("A.h"));
514 auto Shard = MSS.loadShard(testPath("B.h"));
522 auto Shard = MSS.loadShard(testPath("C.h"));
541 FS.Files[testPath("A.cc")] = "#include \"A.h\"";
542 FS.Files[testPath("A.h")] = "";
544 Cmd.Directory = testPath("build");
546 CDB.setCompileCommand(testPath("build/../A.cc"), Cmd);
549 EXPECT_THAT(Storage.keys(), ElementsAre(testPath("A.cc"), testPath("A.h")));
549 EXPECT_THAT(Storage.keys(), ElementsAre(testPath("A.cc"), testPath("A.h")));
551 EXPECT_FALSE(MSS.loadShard(testPath("A.h"))->Cmd);
554 tooling::CompileCommand CmdStored = *MSS.loadShard(testPath("A.cc"))->Cmd;
560 FS.Files[testPath("A.cc")] = " ";
562 CDB.setCompileCommand(testPath("build/../A.cc"), Cmd);
565 EXPECT_FALSE(MSS.loadShard(testPath("A.h"))->Cmd);
568 tooling::CompileCommand CmdStored = *MSS.loadShard(testPath("A.cc"))->Cmd;
tools/clang/tools/extra/clangd/unittests/ClangdTests.cpp 149 FS.Files[testPath(FileWithContents.first)] = FileWithContents.second;
151 auto SourceFilename = testPath(SourceFileRelPath);
206 auto FooCpp = testPath("foo.cpp");
208 FS.Files[testPath("foo.h")] = "int a;";
241 auto FooCpp = testPath("foo.cpp");
242 auto FooH = testPath("foo.h");
290 Server.addDocument(testPath("foo.cpp"), "void main(){}");
330 auto FooCpp = testPath("foo.cpp");
355 auto FooCpp = testPath("foo.cpp");
391 auto FooCpp = testPath("foo.cpp");
443 auto FooCpp = testPath("foo.cpp");
444 auto BarCpp = testPath("bar.cpp");
445 auto BazCpp = testPath("baz.cpp");
487 Path FooCpp = testPath("foo.cpp");
493 Path BarCpp = testPath("bar.cpp");
523 auto FooCpp = testPath("foo.cpp");
583 FilePaths.push_back(testPath(Name));
812 auto FooCpp = testPath("foo.cpp");
835 auto Path = testPath("foo.cpp");
864 auto SourcePath = testPath("source/foo.cpp");
865 auto HeaderPath = testPath("headers/foo.h");
874 CDB.ExtraClangFlags.push_back("-isystem" + testPath("headers"));
939 auto SourcePath = testPath("foo.cpp");
940 auto HeaderPath = testPath("foo.h");
975 auto FooCpp = testPath("foo.cpp");
990 auto FooCpp = testPath("foo.cpp");
1060 auto FooCpp = testPath("foo.cpp");
tools/clang/tools/extra/clangd/unittests/CodeCompleteTests.cpp 110 auto File = testPath("foo.cpp");
128 auto File = testPath(FilePath);
665 std::string Subdir = testPath("sub");
668 std::string BarHeader = testPath("sub/bar.h");
714 std::string BarHeader = testPath("bar.h");
741 FS.Files[testPath("bar.h")] =
743 auto File = testPath("foo.cpp");
793 FS.Files[testPath("foo_header.h")] = R"cpp(
806 Server.addDocument(testPath("foo_impl.cpp"), FileContent);
822 FS.Files[testPath("foo.h")] = R"cpp(
825 runAddDocument(Server, testPath("foo.cpp"), R"cpp(
829 auto File = testPath("bar.cpp");
1019 auto File = testPath("foo.cpp");
1431 std::string DeclFile = URI::create(testPath("foo")).toString();
1455 auto FooH = testPath("foo.h");
1456 auto FooCpp = testPath("foo.cpp");
1495 auto FooCpp = testPath("foo.cpp");
1561 auto FooCpp = testPath("foo.cpp");
1968 FS.Files[testPath("foo.h")] = R"cpp(
1981 auto File = testPath("test.cpp");
2138 auto File = testPath("foo.cpp");
2175 std::string DeclFile = URI::create(testPath("foo")).toString();
2191 std::string FooHeader = testPath("foo.h");
2197 std::string DeclFile = URI::create(testPath("foo")).toString();
2223 std::string FooHeader = testPath("foo.h");
2341 std::string Subdir = testPath("sub");
2344 std::string BarHeader = testPath("sub/bar.h");
tools/clang/tools/extra/clangd/unittests/DexTests.cpp 661 Req.ProximityPaths = {testPath("a/b/c/d/e/f/file.h")};
666 Req.ProximityPaths = {testPath("file.h")};
tools/clang/tools/extra/clangd/unittests/DiagnosticsTests.cpp 410 URIForFile::canonicalize(testPath("foo/bar/main.cpp"), "");
412 URIForFile::canonicalize(testPath("foo/bar/header.h"), "");
tools/clang/tools/extra/clangd/unittests/FSTests.cpp 26 PreambleFileStatusCache StatCache(testPath("main"));
32 EXPECT_TRUE(StatCache.lookup(testPath("x")).hasValue());
33 EXPECT_TRUE(StatCache.lookup(testPath("y")).hasValue());
35 EXPECT_FALSE(StatCache.lookup(testPath("main")).hasValue());
43 auto Cached = ConsumeFS->status(testPath("fake"));
45 EXPECT_EQ(Cached->getName(), testPath("fake"));
50 auto CachedDotDot = ConsumeFS->status(testPath("temp/../fake"));
52 EXPECT_EQ(CachedDotDot->getName(), testPath("temp/../fake"));
tools/clang/tools/extra/clangd/unittests/FileDistanceTests.cpp 70 URIDistance D({{testPath("foo"), CostLots},
tools/clang/tools/extra/clangd/unittests/FileIndexTests.cpp 259 auto FooCpp = testPath("foo.cpp");
260 auto FooH = testPath("foo.h");
384 Index.updateMain(testPath(TU.Filename), AST);
403 Index.updateMain(testPath("foo.h"), HeaderAST);
404 Index.updateMain(testPath("foo.cpp"), CppAST);
tools/clang/tools/extra/clangd/unittests/FindSymbolsTests.cpp 62 FSProvider.Files[testPath("unused")] = "";
81 auto Path = testPath(FileName);
346 std::string FilePath = testPath("foo.cpp");
435 std::string FilePath = testPath("foo.cpp");
456 std::string FilePath = testPath("foo.cpp");
457 addFile(testPath("foo.h"), R"cpp(
468 std::string FilePath = testPath("foo.cpp");
479 std::string FilePath = testPath("foo.h");
497 addFile(testPath("bar.h"), R"cpp(
501 std::string FilePath = testPath("foo.h");
507 addFile(testPath("foo.cpp"), R"cpp(
514 std::string FilePath = testPath("foo.cpp");
551 std::string FilePath = testPath("foo.cpp");
589 std::string FilePath = testPath("foo.cpp");
617 std::string FilePath = testPath("foo.cpp");
638 std::string FilePath = testPath("foo.cpp");
653 std::string FilePath = testPath("foo.cpp");
tools/clang/tools/extra/clangd/unittests/GlobalCompilationDatabaseTests.cpp 43 auto Cmd = DB.getFallbackCommand(testPath("foo/bar.cc"));
44 EXPECT_EQ(Cmd.Directory, testPath("foo"));
46 ElementsAre(EndsWith("clang"), testPath("foo/bar.cc")));
50 Cmd = DB.getFallbackCommand(testPath("foo/bar.h"));
53 testPath("foo/bar.h")));
54 Cmd = DB.getFallbackCommand(testPath("foo/bar"));
57 testPath("foo/bar")));
69 if (File == testPath("foo.cc"))
91 EXPECT_THAT(CDB.getCompileCommand(testPath("foo.cc"))->CommandLine,
92 AllOf(Contains(testPath("foo.cc")), Contains("-DA=1")));
93 EXPECT_EQ(CDB.getCompileCommand(testPath("missing.cc")), llvm::None);
95 auto Override = cmd(testPath("foo.cc"), "-DA=3");
96 CDB.setCompileCommand(testPath("foo.cc"), Override);
97 EXPECT_THAT(CDB.getCompileCommand(testPath("foo.cc"))->CommandLine,
99 EXPECT_EQ(CDB.getCompileCommand(testPath("missing.cc")), llvm::None);
100 CDB.setCompileCommand(testPath("missing.cc"), Override);
101 EXPECT_THAT(CDB.getCompileCommand(testPath("missing.cc"))->CommandLine,
107 EXPECT_THAT(CDB.getFallbackCommand(testPath("bar.cc")).CommandLine,
108 ElementsAre("clang", "-DA=2", testPath("bar.cc"), "-DA=4",
114 EXPECT_EQ(CDB.getCompileCommand(testPath("bar.cc")), None);
115 auto Override = cmd(testPath("bar.cc"), "-DA=5");
116 CDB.setCompileCommand(testPath("bar.cc"), Override);
117 EXPECT_THAT(CDB.getCompileCommand(testPath("bar.cc"))->CommandLine,
120 EXPECT_THAT(CDB.getFallbackCommand(testPath("foo.cc")).CommandLine,
121 ElementsAre(EndsWith("clang"), testPath("foo.cc"), "-DA=6",
144 auto Cmd = CDB.getCompileCommand(testPath("foo.cc")).getValue();
161 CDB.setCompileCommand(testPath("foo.cc"), Cmd);
163 EXPECT_THAT(CDB.getCompileCommand(testPath("foo.cc"))->CommandLine,
165 Contains(testPath("foo.cc")), Not(Contains("-MF")),
299 EXPECT_THAT(DiscoveredFiles, UnorderedElementsAre(testPath("a.cc")));
tools/clang/tools/extra/clangd/unittests/HeaderSourceSwitchTests.cpp 24 auto FooCpp = testPath("foo.cpp");
25 auto FooH = testPath("foo.h");
26 auto Invalid = testPath("main.cpp");
42 auto FooC = testPath("bar.c");
43 auto FooHH = testPath("bar.HH");
52 auto Foo2C = testPath("foo2.C");
53 auto Foo2HH = testPath("foo2.HH");
61 auto Foo3C = testPath("foo3.C");
62 auto Foo3HXX = testPath("foo3.hxx");
153 testPath("a.cpp")},
160 testPath("b.cpp")},
166 testPath("a.cpp")},
180 getCorrespondingHeaderOrSource(testPath(TU.Filename), HeaderAST,
224 testPath("a.h")},
232 testPath("b.h")},
239 testPath("a.h")},
246 getCorrespondingHeaderOrSource(testPath(TU.Filename), AST,
258 testPath("src/include")}; // add search directory.
261 std::string CppPath = testPath("src/lib/test.cpp");
262 std::string HeaderPath = testPath("src/include/test.h");
tools/clang/tools/extra/clangd/unittests/HeadersTests.cpp 36 FS.Files[testPath("sub/EMPTY")] = "";
121 std::string MainFile = testPath("main.cpp");
122 std::string Subdir = testPath("sub");
143 std::string BarHeader = testPath("sub/bar.h");
151 Distance(testPath("sub/bar.h"), 1u)));
155 std::string BazHeader = testPath("sub/baz.h");
157 std::string BarHeader = testPath("sub/bar.h");
169 Distance(testPath("sub/bar.h"), 1u),
170 Distance(testPath("sub/baz.h"), 2u)));
172 EXPECT_THAT(collectIncludes().includeDepth(testPath("sub/bar.h")),
173 UnorderedElementsAre(Distance(testPath("sub/bar.h"), 0u),
174 Distance(testPath("sub/baz.h"), 1u)));
205 std::string Path = testPath("sub/bar.h");
211 MainFile = testPath("main.h");
216 MainFile = testPath("sub/main.cpp");
217 EXPECT_EQ(calculate(testPath("sub2/main.cpp")), "");
221 std::string BarHeader = testPath("sub/bar.h");
226 BarHeader = testPath("sub/bar.h");
232 llvm::sys::path::convert_to_slash(testPath("sub-2/bar.h"));
237 std::string BarHeader = testPath("sub/bar.h");
240 std::string BazHeader = testPath("sub/baz.h");
248 EXPECT_EQ(calculate(testPath("sub/bar.h"), "\"bar.h\"", {Inc}), "");
255 Inc.Resolved = testPath("sub/bar.h");
268 std::string MainFile = testPath("main.cpp");
272 auto HeaderPath = testPath("sub/bar.h");
tools/clang/tools/extra/clangd/unittests/IndexActionTests.cpp 112 std::string MainFilePath = testPath("main.cpp");
114 std::string Level1HeaderPath = testPath("level1.h");
116 std::string Level2HeaderPath = testPath("level2.h");
140 std::string MainFilePath = testPath("main.cpp");
142 std::string HeaderPath = testPath("header.h");
165 std::string MainFilePath = testPath("main.cpp");
171 std::string CommonHeaderPath = testPath("common.h");
178 std::string HeaderPath = testPath("header.h");
204 std::string MainFilePath = testPath("main.cpp");
213 std::string HeaderPath = testPath("header.h");
233 std::string MainFilePath = testPath("main.cpp");
tools/clang/tools/extra/clangd/unittests/ParsedASTTests.cpp 221 Inputs.FS = buildTestFS({{testPath("foo.cpp"), "void test() {}"}});
223 testPath("foo.cpp")};
229 "clang", "-Xclang", "-fsome-unknown-flag", testPath("foo.cpp")};
tools/clang/tools/extra/clangd/unittests/QualityTests.cpp 268 ProxSources.try_emplace(testPath("foo/baz.h"));
tools/clang/tools/extra/clangd/unittests/RenameTests.cpp 83 renameWithinFile(AST, testPath(TU.Filename), Code.point(), "abcde");
180 auto Results = renameWithinFile(AST, testPath(TU.Filename), T.point(),
tools/clang/tools/extra/clangd/unittests/SemanticHighlightingTests.cpp 629 auto FooCpp = testPath("foo.cpp");
tools/clang/tools/extra/clangd/unittests/SemanticSelectionTests.cpp 156 auto FooH = testPath("foo.h");
162 auto FooCpp = testPath("Foo.cpp");
tools/clang/tools/extra/clangd/unittests/SymbolCollectorTests.cpp 249 TestHeaderName(testPath("symbol.h")),
250 TestFileName(testPath("symbol.cc")) {
517 TestFileName = testPath("test.m");
535 TestFileName = testPath("test.m");
658 TestFileName = testPath("foo.cpp");
663 TestFileName = testPath("foo.h");
736 TestHeaderURI = URI::create(testPath(TestHeaderName)).toString();
745 TestHeaderName = testPath("x.h");
746 TestFileName = testPath("x.cpp");
1036 auto IncFile = testPath("test.inc");
1053 TestFileName = testPath("no_ext_main");
1055 auto IncFile = testPath("test.inc");
1073 TestFileName = testPath("main.cc");
1075 auto IncFile = testPath("test.inc");
tools/clang/tools/extra/clangd/unittests/TUSchedulerTests.cpp 133 auto Added = testPath("added.cpp");
136 auto Missing = testPath("missing.cpp");
187 auto Path = testPath("foo.cpp");
218 auto Path = testPath("foo.cpp");
253 auto Path = testPath("foo.cpp");
310 auto Path = testPath("foo.cpp");
383 Files.push_back(testPath(Name));
481 auto Foo = testPath("foo.cpp");
482 auto Bar = testPath("bar.cpp");
483 auto Baz = testPath("baz.cpp");
523 auto Foo = testPath("foo.cpp");
524 auto Header = testPath("foo.h");
567 auto Foo = testPath("foo.cpp");
600 auto Source = testPath("foo.cpp");
601 auto Header = testPath("foo.h");
653 auto FooCpp = testPath("foo.cpp");
729 Server.addDocument(testPath("foo.cpp"), Code.code(), WantDiagnostics::Yes);
730 Server.locateSymbolAt(testPath("foo.cpp"), Code.point(),
762 updateWithDiags(S, testPath("foo.cpp"), "void test() {}",
790 updateWithDiags(S, testPath("foo.cpp"), "void test() {}",
tools/clang/tools/extra/clangd/unittests/TestFS.cpp 112 return testPath(Path);
tools/clang/tools/extra/clangd/unittests/TestTU.cpp 23 std::string FullFilename = testPath(Filename),
24 FullHeaderName = testPath(HeaderFilename),
25 ImportThunk = testPath("import_thunk.h");
tools/clang/tools/extra/clangd/unittests/TweakTesting.cpp 120 if (It.first() == testPath(TU.Filename))
tools/clang/tools/extra/clangd/unittests/TweakTests.cpp 72 EXPECT_EQ(Res->first, testPath(Path));
1259 ElementsAre(FileWithContents(testPath("a.h"), Expected)));
tools/clang/tools/extra/clangd/unittests/TypeHierarchyTests.cpp 629 TypeHierarchyDirection::Children, Index.get(), testPath(TU.Filename));
tools/clang/tools/extra/clangd/unittests/URITests.cpp 135 EXPECT_EQ(resolveOrDie(parseOrDie("unittest:///a"), testPath("x")),
136 testPath("a"));
155 EXPECT_EQ(resolvePathOrDie(testPath("x"), testPath("hint")), testPath("x"));
155 EXPECT_EQ(resolvePathOrDie(testPath("x"), testPath("hint")), testPath("x"));
155 EXPECT_EQ(resolvePathOrDie(testPath("x"), testPath("hint")), testPath("x"));
157 auto Resolve = URI::resolvePath(testPath("x"), FilePath);
163 auto Path = testPath("x");
tools/clang/tools/extra/clangd/unittests/XRefsTests.cpp 562 std::string BuildDir = testPath("build");
570 auto FooCpp = testPath("src/foo.cpp");
572 auto HeaderInPreambleH = testPath("src/header_in_preamble.h");
574 auto HeaderNotInPreambleH = testPath("src/header_not_in_preamble.h");
1860 auto FooCpp = testPath("foo.cpp");
1871 auto FooH = testPath("foo.h");
1918 auto FooM = testPath("foo.m");
1935 auto FooCpp = testPath("foo.cpp");
1942 auto FooH = testPath("foo.h");