diff options
Diffstat (limited to 'clang-tools-extra/unittests/clang-doc/YAMLGeneratorTest.cpp')
-rw-r--r-- | clang-tools-extra/unittests/clang-doc/YAMLGeneratorTest.cpp | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/clang-tools-extra/unittests/clang-doc/YAMLGeneratorTest.cpp b/clang-tools-extra/unittests/clang-doc/YAMLGeneratorTest.cpp index 42849f77cd3..e2295525bdd 100644 --- a/clang-tools-extra/unittests/clang-doc/YAMLGeneratorTest.cpp +++ b/clang-tools-extra/unittests/clang-doc/YAMLGeneratorTest.cpp @@ -25,6 +25,7 @@ std::unique_ptr<Generator> getYAMLGenerator() { TEST(YAMLGeneratorTest, emitNamespaceYAML) { NamespaceInfo I; I.Name = "Namespace"; + I.Path = "path/to/A"; I.Namespace.emplace_back(EmptySID, "A", InfoType::IT_namespace); I.ChildNamespaces.emplace_back(EmptySID, "ChildNamespace", @@ -45,6 +46,7 @@ TEST(YAMLGeneratorTest, emitNamespaceYAML) { R"raw(--- USR: '0000000000000000000000000000000000000000' Name: 'Namespace' +Path: 'path/to/A' Namespace: - Type: Namespace Name: 'A' @@ -69,15 +71,18 @@ ChildEnums: TEST(YAMLGeneratorTest, emitRecordYAML) { RecordInfo I; I.Name = "r"; + I.Path = "path/to/r"; I.Namespace.emplace_back(EmptySID, "A", InfoType::IT_namespace); I.DefLoc = Location(10, llvm::SmallString<16>{"test.cpp"}); I.Loc.emplace_back(12, llvm::SmallString<16>{"test.cpp"}); - I.Members.emplace_back("int", "X", AccessSpecifier::AS_private); + I.Members.emplace_back("int", "path/to/int", "X", + AccessSpecifier::AS_private); I.TagType = TagTypeKind::TTK_Class; - I.Parents.emplace_back(EmptySID, "F", InfoType::IT_record); - I.VirtualParents.emplace_back(EmptySID, "G", InfoType::IT_record); + I.Parents.emplace_back(EmptySID, "F", InfoType::IT_record, "path/to/F"); + I.VirtualParents.emplace_back(EmptySID, "G", InfoType::IT_record, + "path/to/G"); I.ChildRecords.emplace_back(EmptySID, "ChildStruct", InfoType::IT_record); I.ChildFunctions.emplace_back(); @@ -95,6 +100,7 @@ TEST(YAMLGeneratorTest, emitRecordYAML) { R"raw(--- USR: '0000000000000000000000000000000000000000' Name: 'r' +Path: 'path/to/r' Namespace: - Type: Namespace Name: 'A' @@ -108,14 +114,17 @@ TagType: Class Members: - Type: Name: 'int' + Path: 'path/to/int' Name: 'X' Access: Private Parents: - Type: Record Name: 'F' + Path: 'path/to/F' VirtualParents: - Type: Record Name: 'G' + Path: 'path/to/G' ChildRecords: - Type: Record Name: 'ChildStruct' @@ -139,8 +148,9 @@ TEST(YAMLGeneratorTest, emitFunctionYAML) { I.DefLoc = Location(10, llvm::SmallString<16>{"test.cpp"}); I.Loc.emplace_back(12, llvm::SmallString<16>{"test.cpp"}); - I.ReturnType = TypeInfo(EmptySID, "void", InfoType::IT_default); - I.Params.emplace_back("int", "P"); + I.ReturnType = + TypeInfo(EmptySID, "void", InfoType::IT_default, "path/to/void"); + I.Params.emplace_back("int", "path/to/int", "P"); I.IsMethod = true; I.Parent = Reference(EmptySID, "Parent", InfoType::IT_record); @@ -170,10 +180,12 @@ Parent: Params: - Type: Name: 'int' + Path: 'path/to/int' Name: 'P' ReturnType: Type: Name: 'void' + Path: 'path/to/void' ... )raw"; EXPECT_EQ(Expected, Actual.str()); |