diff options
author | Diego Astiazaran <diegoaat97@gmail.com> | 2019-08-12 18:42:46 +0000 |
---|---|---|
committer | Diego Astiazaran <diegoaat97@gmail.com> | 2019-08-12 18:42:46 +0000 |
commit | e27f778a1992177cdd19130a7148dab9e343b747 (patch) | |
tree | 8945e3e998ed450a2e4c47cb4a659e9e526f8055 /clang-tools-extra/unittests/clang-doc/MergeTest.cpp | |
parent | c9f476a503b5a8b053475ee6ae125814fd928342 (diff) | |
download | bcm5719-llvm-e27f778a1992177cdd19130a7148dab9e343b747.tar.gz bcm5719-llvm-e27f778a1992177cdd19130a7148dab9e343b747.zip |
[clang-doc] Generate HTML links for children namespaces/records
Path is now stored in the references to the child while serializing,
then this path is used to generate the relative path in the HTML
generator.
Now some references have paths and some don't so in the reducing phase,
references are now properly merged checking for empty attributes.
Tests added for HTML and YAML generators, merging and serializing.
computeRelativePath function had a bug when the filepath is part of the
given directory; it returned a path that starts with a separator. This
has been fixed.
Differential Revision: https://reviews.llvm.org/D65987
llvm-svn: 368602
Diffstat (limited to 'clang-tools-extra/unittests/clang-doc/MergeTest.cpp')
-rw-r--r-- | clang-tools-extra/unittests/clang-doc/MergeTest.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/clang-tools-extra/unittests/clang-doc/MergeTest.cpp b/clang-tools-extra/unittests/clang-doc/MergeTest.cpp index 7b3e2302ac2..89c68dd823a 100644 --- a/clang-tools-extra/unittests/clang-doc/MergeTest.cpp +++ b/clang-tools-extra/unittests/clang-doc/MergeTest.cpp @@ -87,7 +87,7 @@ TEST(MergeTest, mergeRecordInfos) { One.Parents.emplace_back(EmptySID, "F", InfoType::IT_record); One.VirtualParents.emplace_back(EmptySID, "G", InfoType::IT_record); - One.ChildRecords.emplace_back(NonEmptySID, "ChildStruct", + One.ChildRecords.emplace_back(NonEmptySID, "SharedChildStruct", InfoType::IT_record); One.ChildFunctions.emplace_back(); One.ChildFunctions.back().Name = "OneFunction"; @@ -104,8 +104,8 @@ TEST(MergeTest, mergeRecordInfos) { Two.TagType = TagTypeKind::TTK_Class; - Two.ChildRecords.emplace_back(EmptySID, "OtherChildStruct", - InfoType::IT_record); + Two.ChildRecords.emplace_back(NonEmptySID, "SharedChildStruct", + InfoType::IT_record, "path"); Two.ChildFunctions.emplace_back(); Two.ChildFunctions.back().Name = "TwoFunction"; Two.ChildEnums.emplace_back(); @@ -127,10 +127,8 @@ TEST(MergeTest, mergeRecordInfos) { Expected->Parents.emplace_back(EmptySID, "F", InfoType::IT_record); Expected->VirtualParents.emplace_back(EmptySID, "G", InfoType::IT_record); - Expected->ChildRecords.emplace_back(NonEmptySID, "ChildStruct", - InfoType::IT_record); - Expected->ChildRecords.emplace_back(EmptySID, "OtherChildStruct", - InfoType::IT_record); + Expected->ChildRecords.emplace_back(NonEmptySID, "SharedChildStruct", + InfoType::IT_record, "path"); Expected->ChildFunctions.emplace_back(); Expected->ChildFunctions.back().Name = "OneFunction"; Expected->ChildFunctions.back().USR = NonEmptySID; |