https://github.com/evelez7 updated https://github.com/llvm/llvm-project/pull/175112
>From bff604e15a5ce00df444ff73ca5f0198999fd4c4 Mon Sep 17 00:00:00 2001 From: Erick Velez <[email protected]> Date: Thu, 8 Jan 2026 15:40:46 -0800 Subject: [PATCH] fix tests --- clang-tools-extra/clang-doc/JSONGenerator.cpp | 4 +- .../clang-doc/assets/alias-template.mustache | 2 +- .../clang-doc/assets/class-template.mustache | 50 ++++++++----------- .../assets/comment-template.mustache | 2 +- .../clang-doc/assets/enum-template.mustache | 16 ++---- .../clang-doc/assets/index-template.mustache | 6 +-- .../assets/namespace-template.mustache | 6 +-- .../clang-doc/basic-project.mustache.test | 8 +-- clang-tools-extra/test/clang-doc/enum.cpp | 13 +++-- clang-tools-extra/test/clang-doc/index.cpp | 10 ++-- .../test/clang-doc/json/class-template.cpp | 11 ++-- .../test/clang-doc/json/class.cpp | 40 +++++++-------- .../test/clang-doc/json/method-template.cpp | 2 +- .../test/clang-doc/mustache-index.cpp | 12 ++--- .../test/clang-doc/namespace.cpp | 8 +-- .../unittests/clang-doc/JSONGeneratorTest.cpp | 22 ++++---- 16 files changed, 98 insertions(+), 114 deletions(-) diff --git a/clang-tools-extra/clang-doc/JSONGenerator.cpp b/clang-tools-extra/clang-doc/JSONGenerator.cpp index ad76c40d49db8..d3138af7f6474 100644 --- a/clang-tools-extra/clang-doc/JSONGenerator.cpp +++ b/clang-tools-extra/clang-doc/JSONGenerator.cpp @@ -626,9 +626,9 @@ static void serializeInfo(const RecordInfo &I, json::Object &Obj, } if (!PubFunctionsArrayRef.empty()) - insertArray(Obj, PubFunctionsArray, "PublicFunctions"); + insertArray(Obj, PubFunctionsArray, "PublicMethods"); if (!ProtFunctionsArrayRef.empty()) - insertArray(Obj, ProtFunctionsArray, "ProtectedFunctions"); + insertArray(Obj, ProtFunctionsArray, "ProtectedMethods"); } if (!I.Members.empty()) { diff --git a/clang-tools-extra/clang-doc/assets/alias-template.mustache b/clang-tools-extra/clang-doc/assets/alias-template.mustache index 9b32f132e9ef3..0977233cbf15a 100644 --- a/clang-tools-extra/clang-doc/assets/alias-template.mustache +++ b/clang-tools-extra/clang-doc/assets/alias-template.mustache @@ -2,7 +2,7 @@ {{#Template}} <pre><code class="language-cpp code-clang-doc">template <{{#Parameters}}{{Param}}{{^End}}, {{/End}}{{/Parameters}}></code></pre> {{/Template}} - <pre><code class="language-cpp code-clang-doc">{{#IsUsing}}using{{/IsUsing}}{{^IsUsing}}typedef{{/IsUsing}} {{Name}}{{#IsUsing}} ={{/Isusing}} {{#Underlying}}{{Name}}{{/Underlying}}</code></pre> + <pre><code class="language-cpp code-clang-doc">{{#IsUsing}}using{{/IsUsing}}{{^IsUsing}}typedef{{/IsUsing}} {{Name}}{{#IsUsing}} ={{/IsUsing}}{{#Underlying}} {{Name}}{{/Underlying}}</code></pre> {{#Description}} {{>Comments}} {{/Description}} diff --git a/clang-tools-extra/clang-doc/assets/class-template.mustache b/clang-tools-extra/clang-doc/assets/class-template.mustache index ef5a7572a3f48..8ff892ecef760 100644 --- a/clang-tools-extra/clang-doc/assets/class-template.mustache +++ b/clang-tools-extra/clang-doc/assets/class-template.mustache @@ -47,38 +47,38 @@ </details> </li> {{/HasProtectedMembers}} - {{#HasPublicFunctions}} + {{#HasPublicMethods}} <li> <details open> <summary class="sidebar-section"> - <a class="sidebar-item" href="#PublicMethods">Public Method</a> + <a class="sidebar-item" href="#PublicMethods">Public Methods</a> </summary> <ul> - {{#PublicFunctions}} + {{#PublicMethods}} <li class="sidebar-item-container"> <a class="sidebar-item" href="#{{USR}}">{{Name}}</a> </li> - {{/PublicFunctions}} + {{/PublicMethods}} </ul> </details> </li> - {{/HasPublicFunctions}} - {{#HasProtectedFunctions}} + {{/HasPublicMethods}} + {{#HasProtectedMethods}} <li> <details open> <summary class="sidebar-section"> <a class="sidebar-item" href="#ProtectedMethods">Protected Methods</a> </summary> <ul> - {{#ProtectedFunctions}} + {{#ProtectedMethods}} <li class="sidebar-item-container"> <a class="sidebar-item" href="#{{USR}}">{{Name}}</a> </li> - {{/ProtectedFunctions}} + {{/ProtectedMethods}} </ul> </details> </li> - {{/HasProtectedFunctions}} + {{/HasProtectedMethods}} {{#HasEnums}} <li> <details open> @@ -115,7 +115,7 @@ <li> <details open> <summary class="sidebar-section"> - <a class="sidebar-item" href="#Classes">Inner Classes</a> + <a class="sidebar-item" href="#Records">Records</a> </summary> <ul> {{#Records}} @@ -142,7 +142,7 @@ </ul> </details> </li> - {{/HasRecords}} + {{/HasFriends}} </ul> </div> <div class="resizer" id="resizer"></div> @@ -168,11 +168,6 @@ {{#PublicMembers}} <div id="{{Name}}" class="delimiter-container"> <pre><code class="language-cpp code-clang-doc" >{{#IsStatic}}static {{/IsStatic}}{{Type}} {{Name}}</code></pre> - {{#MemberComments}} - <div> - {{>Comments}} - </div> - {{/MemberComments}} </div> {{/PublicMembers}} </div> @@ -190,24 +185,24 @@ </div> </section> {{/HasProtectedMembers}} - {{#HasPublicFunctions}} + {{#HasPublicMethods}} <section id="PublicMethods" class="section-container"> <h2>Public Methods</h2> - {{#PublicFunctions}} + {{#PublicMethods}} {{>FunctionPartial}} - {{/PublicFunctions}} + {{/PublicMethods}} </section> - {{/PublicFunctions}} - {{#HasProtectedFunctions}} + {{/HasPublicMethods}} + {{#HasProtectedMethods}} <section id="ProtectedMethods" class="section-container"> <h2>Protected Methods</h2> <div> - {{#ProtectedFunctions}} + {{#ProtectedMethods}} {{>FunctionPartial}} - {{/ProtectedFunctions}} + {{/ProtectedMethods}} </div> </section> - {{/HasProtectedFunctions}} + {{/HasProtectedMethods}} {{#HasEnums}} <section id="Enums" class="section-container"> <h2>Enumerations</h2> @@ -217,8 +212,8 @@ </section> {{/HasEnums}} {{#HasRecords}} - <section id="Classes" class="section-container"> - <h2>Inner Classes</h2> + <section id="Records" class="section-container"> + <h2>Records</h2> <ul class="class-container"> {{#Records}} <li id="{{USR}}" style="max-height: 40px;"> @@ -252,9 +247,6 @@ {{^IsClass}} <pre><code class="language-cpp code-clang-doc">{{ReturnType.Name}} {{Name}}{{#Template}}{{#Specialization}}<{{#Parameters}}{{Param}}{{^End}}, {{/End}}{{/Parameters}}>{{/Specialization}}{{/Template}} ({{#Params}}{{Type.QualName}} {{Name}}{{^End}}, {{/End}}{{/Params}})</code></pre> {{/IsClass}} - {{#.Description}} - {{>Comments}} - {{/.Description}} </div> {{/Friends}} </section> diff --git a/clang-tools-extra/clang-doc/assets/comment-template.mustache b/clang-tools-extra/clang-doc/assets/comment-template.mustache index 23bd1bfee4f80..11419cce49eb0 100644 --- a/clang-tools-extra/clang-doc/assets/comment-template.mustache +++ b/clang-tools-extra/clang-doc/assets/comment-template.mustache @@ -42,7 +42,7 @@ <b>{{ParamName}}</b> {{#Explicit}}{{Direction}}{{/Explicit}} {{#Children}}{{TextComment}}{{/Children}} </div> </div> -{{/#TParamComments}} +{{/TParamComments}} {{/HasTParamComments}} {{#HasReturnComments}} <div class="nested-delimiter-container"> diff --git a/clang-tools-extra/clang-doc/assets/enum-template.mustache b/clang-tools-extra/clang-doc/assets/enum-template.mustache index af1364c4d37f6..cfba6588f0aa7 100644 --- a/clang-tools-extra/clang-doc/assets/enum-template.mustache +++ b/clang-tools-extra/clang-doc/assets/enum-template.mustache @@ -15,9 +15,6 @@ <tr> <th>Name</th> <th>Value</th> - {{#HasComment}} - <th>Comment</th> - {{/HasComment}} </tr> {{#Members}} <tr> @@ -29,21 +26,16 @@ {{^Value}} <td>{{ValueExpr}}</td> {{/Value}} - {{#EnumValueComments}} - <td>{{>Comments}}</td> - {{/EnumValueComments}} </tr> {{/Members}} </tbody> </table> - {{#EnumComments}} - <div> + {{#Description}} + <div class="doc-card"> {{>Comments}} </div> - {{/EnumComments}} + {{/Description}} {{#Location}} - <div> - Defined at line {{LineNumber}} of file {{Filename}} - </div> + <p>Defined at line {{LineNumber}} of file {{Filename}}</p> {{/Location}} </div> diff --git a/clang-tools-extra/clang-doc/assets/index-template.mustache b/clang-tools-extra/clang-doc/assets/index-template.mustache index cee7df872a0e8..40876e556b97d 100644 --- a/clang-tools-extra/clang-doc/assets/index-template.mustache +++ b/clang-tools-extra/clang-doc/assets/index-template.mustache @@ -11,12 +11,12 @@ <li> <details open> <summary class="sidebar-section"> - <a class="sidebar-item" href="#Namespaces">Namespaces</a> + <a class="sidebar-item" href="#Index">Index</a> </summary> <ul> {{#Index}} <li class="sidebar-item-container"> - <a class="sidebar-item" href="#{{Name}}">{{Name}}</a> + <a class="sidebar-item" href="#{{USR}}">{{Name}}</a> </li> {{/Index}} </ul> @@ -31,7 +31,7 @@ {{#Index}} <div> <a href="{{#Path}}{{Path}}/{{/Path}}{{Name}}/index.html"> - <pre><code class="language-cpp code-clang-doc">namespace {{Name}}</code></pre> + <pre><code id="{{USR}}" class="language-cpp code-clang-doc">namespace {{Name}}</code></pre> </a> </div> {{/Index}} diff --git a/clang-tools-extra/clang-doc/assets/namespace-template.mustache b/clang-tools-extra/clang-doc/assets/namespace-template.mustache index 567af626714ef..0fc5a00642df7 100644 --- a/clang-tools-extra/clang-doc/assets/namespace-template.mustache +++ b/clang-tools-extra/clang-doc/assets/namespace-template.mustache @@ -35,7 +35,7 @@ <li> <details open> <summary class="sidebar-section"> - <a class="sidebar-item" href="#Classes">Inner Classes</a> + <a class="sidebar-item" href="#Records">Records</a> </summary> <ul> {{#Records}} @@ -140,8 +140,8 @@ </section> {{/HasEnums}} {{#HasRecords}} - <section id="Classes" class="section-container"> - <h2>Inner Classes</h2> + <section id="Records" class="section-container"> + <h2>Records</h2> <ul class="class-container"> {{#Records}} <li id="{{USR}}" style="max-height: 40px;"> diff --git a/clang-tools-extra/test/clang-doc/basic-project.mustache.test b/clang-tools-extra/test/clang-doc/basic-project.mustache.test index d1f3e910bb31f..aeb910a6940f1 100644 --- a/clang-tools-extra/test/clang-doc/basic-project.mustache.test +++ b/clang-tools-extra/test/clang-doc/basic-project.mustache.test @@ -42,7 +42,7 @@ HTML-SHAPE: <ul> HTML-SHAPE: <li> HTML-SHAPE: <details open> HTML-SHAPE: <summary class="sidebar-section"> -HTML-SHAPE: <a class="sidebar-item" href="#PublicMethods">Public Method</a> +HTML-SHAPE: <a class="sidebar-item" href="#PublicMethods">Public Methods</a> HTML-SHAPE: </summary> HTML-SHAPE: <ul> HTML-SHAPE: <li class="sidebar-item-container"> @@ -167,7 +167,7 @@ HTML-CALC: </li> HTML-CALC: <li> HTML-CALC: <details open> HTML-CALC: <summary class="sidebar-section"> -HTML-CALC: <a class="sidebar-item" href="#PublicMethods">Public Method</a> +HTML-CALC: <a class="sidebar-item" href="#PublicMethods">Public Methods</a> HTML-CALC: </summary> HTML-CALC: <ul> HTML-CALC: <li class="sidebar-item-container"> @@ -366,7 +366,7 @@ HTML-RECTANGLE: <ul> HTML-RECTANGLE: <li> HTML-RECTANGLE: <details open> HTML-RECTANGLE: <summary class="sidebar-section"> -HTML-RECTANGLE: <a class="sidebar-item" href="#PublicMethods">Public Method</a> +HTML-RECTANGLE: <a class="sidebar-item" href="#PublicMethods">Public Methods</a> HTML-RECTANGLE: </summary> HTML-RECTANGLE: <ul> HTML-RECTANGLE: <li class="sidebar-item-container"> @@ -480,7 +480,7 @@ HTML-CIRCLE: <ul> HTML-CIRCLE: <li> HTML-CIRCLE: <details open> HTML-CIRCLE: <summary class="sidebar-section"> -HTML-CIRCLE: <a class="sidebar-item" href="#PublicMethods">Public Method</a> +HTML-CIRCLE: <a class="sidebar-item" href="#PublicMethods">Public Methods</a> HTML-CIRCLE: </summary> HTML-CIRCLE: <ul> HTML-CIRCLE: <li class="sidebar-item-container"> diff --git a/clang-tools-extra/test/clang-doc/enum.cpp b/clang-tools-extra/test/clang-doc/enum.cpp index ce844ec072564..6e11bbf065f25 100644 --- a/clang-tools-extra/test/clang-doc/enum.cpp +++ b/clang-tools-extra/test/clang-doc/enum.cpp @@ -21,7 +21,7 @@ */ enum Color { // MD-INDEX-LINE: *Defined at {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}enum.cpp#[[@LINE-1]]* - // HTML-INDEX-LINE-NOT: <p>Defined at line [[@LINE-2]] of file {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}enum.cpp</p> + // HTML-INDEX-LINE: <p>Defined at line [[@LINE-2]] of file {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}enum.cpp</p> Red, ///< Comment 1 Green, ///< Comment 2 Blue ///< Comment 3 @@ -64,7 +64,7 @@ enum Color { */ enum class Shapes { // MD-INDEX-LINE: *Defined at {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}enum.cpp#[[@LINE-1]]* - // HTML-INDEX-LINE-NOT: <p>Defined at line [[@LINE-2]] of file {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}enum.cpp</p> + // HTML-INDEX-LINE: <p>Defined at line [[@LINE-2]] of file {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}enum.cpp</p> /// Comment 1 Circle, @@ -115,7 +115,7 @@ class Animals { */ enum AnimalType { // MD-ANIMAL-LINE: *Defined at {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}enum.cpp#[[@LINE-1]]* - // HTML-ANIMAL-LINE-NOT: <p>Defined at line [[@LINE-2]] of file {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}enum.cpp</p> + // HTML-ANIMAL-LINE: <p>Defined at line [[@LINE-2]] of file {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}enum.cpp</p> Dog, ///< Man's best friend Cat, ///< Man's other best friend Iguana ///< A lizard @@ -148,9 +148,12 @@ class Animals { // HTML-ANIMAL-NEXT: </tr> // HTML-ANIMAL-NEXT: </tbody> // HTML-ANIMAL-NEXT: </table> -// HTML-ANIMAL-NEXT: <div> -// HTML-ANIMAL-NEXT: Defined at line 116 of file {{.*}}enum.cpp +// HTML-ANIMAL-NEXT: <div class="doc-card"> +// HTML-ANIMAL-NEXT: <div class="nested-delimiter-container"> +// HTML-ANIMAL-NEXT: <p> specify what animal the class is</p> +// HTML-ANIMAL-NEXT: </div> // HTML-ANIMAL-NEXT: </div> +// HTML-ANIMAL-NEXT: <p>Defined at line 116 of file {{.*}}enum.cpp</p> // HTML-ANIMAL-NEXT: </div> // HTML-ANIMAL-NEXT: </section> diff --git a/clang-tools-extra/test/clang-doc/index.cpp b/clang-tools-extra/test/clang-doc/index.cpp index 5ff183f8d80ad..af72720740fae 100644 --- a/clang-tools-extra/test/clang-doc/index.cpp +++ b/clang-tools-extra/test/clang-doc/index.cpp @@ -30,14 +30,14 @@ namespace inner { // CHECK-HTML-NEXT: <li> // CHECK-HTML-NEXT: <details open> // CHECK-HTML-NEXT: <summary class="sidebar-section"> -// CHECK-HTML-NEXT: <a class="sidebar-item" href="#Namespaces">Namespaces</a> +// CHECK-HTML-NEXT: <a class="sidebar-item" href="#Index">Index</a> // CHECK-HTML-NEXT: </summary> // CHECK-HTML-NEXT: <ul> // CHECK-HTML-NEXT: <li class="sidebar-item-container"> -// CHECK-HTML-NEXT: <a class="sidebar-item" href="#GlobalNamespace">GlobalNamespace</a> +// CHECK-HTML-NEXT: <a class="sidebar-item" href="#{{([0-9A-F]{40})}}">GlobalNamespace</a> // CHECK-HTML-NEXT: </li> // CHECK-HTML-NEXT: <li class="sidebar-item-container"> -// CHECK-HTML-NEXT: <a class="sidebar-item" href="#inner">inner</a> +// CHECK-HTML-NEXT: <a class="sidebar-item" href="#{{([0-9A-F]{40})}}">inner</a> // CHECK-HTML-NEXT: </li> // CHECK-HTML-NEXT: </ul> // CHECK-HTML-NEXT: </details> @@ -50,12 +50,12 @@ namespace inner { // CHECK-HTML-NEXT: <h2>Index</h2> // CHECK-HTML-NEXT: <div> // CHECK-HTML-NEXT: <a href="GlobalNamespace/index.html"> -// CHECK-HTML-NEXT: <pre><code class="language-cpp code-clang-doc">namespace GlobalNamespace</code></pre> +// CHECK-HTML-NEXT: <pre><code id="{{([0-9A-F]{40})}}" class="language-cpp code-clang-doc">namespace GlobalNamespace</code></pre> // CHECK-HTML-NEXT: </a> // CHECK-HTML-NEXT: </div> // CHECK-HTML-NEXT: <div> // CHECK-HTML-NEXT: <a href="inner/index.html"> -// CHECK-HTML-NEXT: <pre><code class="language-cpp code-clang-doc">namespace inner</code></pre> +// CHECK-HTML-NEXT: <pre><code id="{{([0-9A-F]{40})}}" class="language-cpp code-clang-doc">namespace inner</code></pre> // CHECK-HTML-NEXT: </a> // CHECK-HTML-NEXT: </div> // CHECK-HTML-NEXT: </section> diff --git a/clang-tools-extra/test/clang-doc/json/class-template.cpp b/clang-tools-extra/test/clang-doc/json/class-template.cpp index 26234509dc183..67bf910a8e88d 100644 --- a/clang-tools-extra/test/clang-doc/json/class-template.cpp +++ b/clang-tools-extra/test/clang-doc/json/class-template.cpp @@ -8,6 +8,13 @@ template<typename T> struct MyClass { }; // CHECK: "Name": "MyClass", +// CHECK: "PublicMembers": [ +// CHECK-NEXT: { +// CHECK-NEXT: "IsStatic": false, +// CHECK-NEXT: "Name": "MemberTemplate", +// CHECK-NEXT: "Type": "T" +// CHECK-NEXT: } +// CHECK-NEXT: ], // CHECK: "Name": "method", // CHECK: "Params": [ // CHECK-NEXT: { @@ -24,10 +31,8 @@ template<typename T> struct MyClass { // CHECK-NEXT: "IsBuiltIn": false, // CHECK-NEXT: "IsTemplate": true, // CHECK-NEXT: "Name": "T", -// CHECK-NEXT: "QualName": "T" +// CHECK-NEXT: "QualName": "T", // CHECK-NEXT: "USR": "0000000000000000000000000000000000000000" -// CHECK: "Name": "MemberTemplate", -// CHECK: "Type": "T" // CHECK: "Template": { // CHECK-NEXT: "Parameters": [ // CHECK-NEXT: { diff --git a/clang-tools-extra/test/clang-doc/json/class.cpp b/clang-tools-extra/test/clang-doc/json/class.cpp index c4f0b2166a3f8..d9ea023bf6827 100644 --- a/clang-tools-extra/test/clang-doc/json/class.cpp +++ b/clang-tools-extra/test/clang-doc/json/class.cpp @@ -170,10 +170,10 @@ struct MyClass { // CHECK-NEXT: "HasEnums": true, // CHECK-NEXT: "HasFriends": true, // CHECK-NEXT: "HasPrivateMembers": true, -// CHECK-NEXT: "HasProtectedFunctions": true, // CHECK-NEXT: "HasProtectedMembers": true, -// CHECK-NEXT: "HasPublicFunctions": true, +// CHECK-NEXT: "HasProtectedMethods": true, // CHECK-NEXT: "HasPublicMembers": true, +// CHECK-NEXT: "HasPublicMethods": true, // CHECK-NEXT: "HasRecords": true, // CHECK-NEXT: "HasTypedefs": true, // CHECK-NEXT: "InfoType": "record", @@ -195,7 +195,14 @@ struct MyClass { // CHECK-NEXT: "Type": "int" // CHECK-NEXT: } // CHECK-NEXT: ], -// CHECK-NEXT: "ProtectedFunctions": [ +// CHECK-NEXT: "ProtectedMembers": [ +// CHECK-NEXT: { +// CHECK-NEXT: "IsStatic": false, +// CHECK-NEXT: "Name": "ProtectedField", +// CHECK-NEXT: "Type": "int" +// CHECK-NEXT: } +// CHECK-NEXT: ], +// CHECK-NEXT: "ProtectedMethods": [ // CHECK-NEXT: { // CHECK-NEXT: "InfoType": "function", // CHECK-NEXT: "IsStatic": false, @@ -214,14 +221,14 @@ struct MyClass { // CHECK-NEXT: "USR": "{{[0-9A-F]*}}" // CHECK-NEXT: } // CHECK-NEXT: ], -// CHECK-NEXT: "ProtectedMembers": [ +// CHECK: "PublicMembers": [ // CHECK-NEXT: { // CHECK-NEXT: "IsStatic": false, -// CHECK-NEXT: "Name": "ProtectedField", +// CHECK-NEXT: "Name": "PublicField", // CHECK-NEXT: "Type": "int" // CHECK-NEXT: } // CHECK-NEXT: ], -// CHECK-NEXT: "PublicFunctions": [ +// CHECK-NEXT: "PublicMethods": [ // CHECK-NEXT: { // CHECK-NEXT: "InfoType": "function", // CHECK-NEXT: "IsStatic": false, @@ -259,14 +266,7 @@ struct MyClass { // CHECK-NEXT: "QualName": "const int &", // CHECK-NEXT: "USR": "{{[0-9A-F]*}}" // CHECK-NEXT: }, -// CHECK: "PublicMembers": [ -// CHECK-NEXT: { -// CHECK-NEXT: "IsStatic": false, -// CHECK-NEXT: "Name": "PublicField", -// CHECK-NEXT: "Type": "int" -// CHECK-NEXT: } -// CHECK-NEXT: ], -// CHECK-NEXT: "Records": [ +// CHECK: "Records": [ // CHECK-NEXT: { // CHECK-NEXT: "DocumentationFileName": "_ZTVN7MyClass11NestedClassE", // CHECK-NEXT: "End": true, @@ -303,7 +303,7 @@ struct MyClass { // CHECK: "USR": "{{[0-9A-F]*}}" // CHECK-NEXT: } -// HTML: <a class="sidebar-item" href="#Classes">Inner Classes</a> +// HTML: <a class="sidebar-item" href="#Records">Records</a> // HTML-NEXT: </summary> // HTML-NEXT: <ul> // HTML-NEXT: <li class="sidebar-item-container"> @@ -338,8 +338,8 @@ struct MyClass { // HTML-NEXT: </div> // HTML-NEXT: </div> // HTML-NEXT: </section> -// HTML: <section id="Classes" class="section-container"> -// HTML-NEXT: <h2>Inner Classes</h2> +// HTML: <section id="Records" class="section-container"> +// HTML-NEXT: <h2>Records</h2> // HTML-NEXT: <ul class="class-container"> // HTML-NEXT: <li id="{{([0-9A-F]{40})}}" style="max-height: 40px;"> // HTML-NEXT: <a href="MyClass/_ZTVN7MyClass11NestedClassE.html"> @@ -353,14 +353,8 @@ struct MyClass { // HTML-NEXT: <div id="{{([0-9A-F]{40})}}" class="delimiter-container"> // HTML-NEXT: <pre><code class="language-cpp code-clang-doc">template <typename T></code></pre> // HTML-NEXT: <pre><code class="language-cpp code-clang-doc">void MyClass (int )</code></pre> -// HTML-NEXT: <div class="nested-delimiter-container"> -// HTML-NEXT: <p> This is a function template friend.</p> -// HTML-NEXT: </div> // HTML-NEXT: </div> // HTML-NEXT: <div id="{{([0-9A-F]{40})}}" class="delimiter-container"> // HTML-NEXT: <pre><code class="language-cpp code-clang-doc">class Foo</code></pre> -// HTML-NEXT: <div class="nested-delimiter-container"> -// HTML-NEXT: <p> This is a struct friend.</p> -// HTML-NEXT: </div> // HTML-NEXT: </div> // HTML-NEXT: </section> diff --git a/clang-tools-extra/test/clang-doc/json/method-template.cpp b/clang-tools-extra/test/clang-doc/json/method-template.cpp index 9cfefa32158ef..189221512b674 100644 --- a/clang-tools-extra/test/clang-doc/json/method-template.cpp +++ b/clang-tools-extra/test/clang-doc/json/method-template.cpp @@ -7,7 +7,7 @@ struct MyClass { } }; -// CHECK: "PublicFunctions": [ +// CHECK: "PublicMethods": [ // CHECK-NEXT: { // CHECK-NEXT: "InfoType": "function", // CHECK-NEXT: "IsStatic": false, diff --git a/clang-tools-extra/test/clang-doc/mustache-index.cpp b/clang-tools-extra/test/clang-doc/mustache-index.cpp index 9706307287f9b..6e308ada51a45 100644 --- a/clang-tools-extra/test/clang-doc/mustache-index.cpp +++ b/clang-tools-extra/test/clang-doc/mustache-index.cpp @@ -1,5 +1,5 @@ // RUN: rm -rf %t && mkdir -p %t -// RUN: clang-doc --format=html --output=%t --executor=standalone %s +// RUN: clang-doc --format=html --doxygen --output=%t --executor=standalone %s // RUN: FileCheck %s < %t/html/GlobalNamespace/index.html enum Color { @@ -19,7 +19,7 @@ class Foo; // CHECK-NEXT: </li> // CHECK-NEXT: </ul> // CHECK: <summary class="sidebar-section"> -// CHECK-NEXT: <a class="sidebar-item" href="#Classes">Inner Classes</a> +// CHECK-NEXT: <a class="sidebar-item" href="#Records">Records</a> // CHECK-NEXT: </summary> // CHECK-NEXT: <ul> // CHECK-NEXT: <li class="sidebar-item-container"> @@ -54,15 +54,13 @@ class Foo; // CHECK-NEXT: </tr> // CHECK-NEXT: </tbody> // CHECK-NEXT: </table> -// CHECK-NEXT: <div> -// CHECK-NEXT: Defined at line 5 of file {{.*}}mustache-index.cpp -// CHECK-NEXT: </div> +// CHECK-NEXT: <p>Defined at line 5 of file {{.*}}mustache-index.cpp</p> // CHECK-NEXT: </div> // CHECK-NEXT: </div> // CHECK-NEXT: </section> -// CHECK: <section id="Classes" class="section-container"> -// CHECK-NEXT: <h2>Inner Classes</h2> +// CHECK: <section id="Records" class="section-container"> +// CHECK-NEXT: <h2>Records</h2> // CHECK-NEXT: <ul class="class-container"> // CHECK-NEXT: <li id="{{[0-9A-F]*}}" style="max-height: 40px;"> // CHECK-NEXT: <a href="_ZTV3Foo.html"> diff --git a/clang-tools-extra/test/clang-doc/namespace.cpp b/clang-tools-extra/test/clang-doc/namespace.cpp index a7c025fd7254e..49e61dc61872e 100644 --- a/clang-tools-extra/test/clang-doc/namespace.cpp +++ b/clang-tools-extra/test/clang-doc/namespace.cpp @@ -67,7 +67,7 @@ class AnonClass {}; // HTML-ANON-INDEX: <a href="../GlobalNamespace/index.html"><div class="navbar-breadcrumb-item">Global Namespace</div></a> // HTML-ANON-INDEX: </div> // HTML-ANON-INDEX: <h2>@nonymous_namespace</h2> -// HTML-ANON-INDEX: <h2>Inner Classes</h2> +// HTML-ANON-INDEX: <h2>Records</h2> // HTML-ANON-INDEX: <ul class="class-container"> // HTML-ANON-INDEX: <li id="{{([0-9A-F]{40})}}" style="max-height: 40px;"> // HTML-ANON-INDEX: <a href="_ZTVN12_GLOBAL__N_19AnonClassE.html"> @@ -136,7 +136,7 @@ class ClassInNestedNamespace {}; // HTML-NESTED-INDEX: <a href="../index.html"><div class="navbar-breadcrumb-item">PrimaryNamespace</div></a> // HTML-NESTED-INDEX: </div> // HTML-NESTED-INDEX: <h2>NestedNamespace</h2> -// HTML-NESTED-INDEX: <h2>Inner Classes</h2> +// HTML-NESTED-INDEX: <h2>Records</h2> // HTML-NESTED-INDEX: <ul class="class-container"> // HTML-NESTED-INDEX: <li id="{{([0-9A-F]{40})}}" style="max-height: 40px;"> // HTML-NESTED-INDEX: <a href="_ZTVN16PrimaryNamespace15NestedNamespace22ClassInNestedNamespaceE.html"> @@ -171,7 +171,7 @@ class ClassInNestedNamespace {}; // HTML-PRIMARY-INDEX: <h2>PrimaryNamespace</h2> // HTML-PRIMARY-INDEX-NOT: <h2 id="Namespaces">Namespaces</h2> // HTML-PRIMARY-INDEX-NOT: <a href="NestedNamespace{{[\/]}}index.html">NestedNamespace</a> -// HTML-PRIMARY-INDEX: <h2>Inner Classes</h2> +// HTML-PRIMARY-INDEX: <h2>Records</h2> // HTML-PRIMARY-INDEX: <ul class="class-container"> // HTML-PRIMARY-INDEX: <li id="{{([0-9A-F]{40})}}" style="max-height: 40px;"> // HTML-PRIMARY-INDEX: <a href="_ZTVN16PrimaryNamespace23ClassInPrimaryNamespaceE.html"> @@ -223,7 +223,7 @@ class ClassInAnotherNamespace {}; // HTML-ANOTHER-INDEX: <a href="../GlobalNamespace/index.html"><div class="navbar-breadcrumb-item">Global Namespace</div></a> // HTML-ANOTHER-INDEX: </div> // HTML-ANOTHER-INDEX: <h2>AnotherNamespace</h2> -// HTML-ANOTHER-INDEX: <h2>Inner Classes</h2> +// HTML-ANOTHER-INDEX: <h2>Records</h2> // HTML-ANOTHER-INDEX: <ul class="class-container"> // HTML-ANOTHER-INDEX: <li id="{{([0-9A-F]{40})}}" style="max-height: 40px;"> // HTML-ANOTHER-INDEX: <a href="_ZTVN16AnotherNamespace23ClassInAnotherNamespaceE.html"> diff --git a/clang-tools-extra/unittests/clang-doc/JSONGeneratorTest.cpp b/clang-tools-extra/unittests/clang-doc/JSONGeneratorTest.cpp index d4260ebae3123..021748895b208 100644 --- a/clang-tools-extra/unittests/clang-doc/JSONGeneratorTest.cpp +++ b/clang-tools-extra/unittests/clang-doc/JSONGeneratorTest.cpp @@ -64,8 +64,8 @@ TEST_F(JSONGeneratorTest, emitRecordJSON) { { "Access": "public", "End": true, - "HasPublicFunctions": true, "HasPublicMembers": true, + "HasPublicMethods": true, "InfoType": "record", "IsParent": true, "IsTypedef": false, @@ -73,7 +73,14 @@ TEST_F(JSONGeneratorTest, emitRecordJSON) { "MangledName": "", "Name": "F", "Path": "path/to/F", - "PublicFunctions": [ + "PublicMembers": [ + { + "IsStatic": false, + "Name": "N", + "Type": "int" + } + ], + "PublicMethods": [ { "InfoType": "function", "IsStatic": false, @@ -88,13 +95,6 @@ TEST_F(JSONGeneratorTest, emitRecordJSON) { "USR": "0000000000000000000000000000000000000000" } ], - "PublicMembers": [ - { - "IsStatic": false, - "Name": "N", - "Type": "int" - } - ], "TagType": "struct", "USR": "0000000000000000000000000000000000000000" } @@ -118,7 +118,7 @@ TEST_F(JSONGeneratorTest, emitRecordJSON) { "HasEnums": true, "HasParents": true, "HasProtectedMembers": true, - "HasPublicFunctions": true, + "HasPublicMethods": true, "HasRecords": true, "HasVirtualParents": true, "InfoType": "record", @@ -148,7 +148,7 @@ TEST_F(JSONGeneratorTest, emitRecordJSON) { "Type": "int" } ], - "PublicFunctions": [ + "PublicMethods": [ { "InfoType": "function", "IsStatic": false, _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
