1 // RUN: rm -rf %t && mkdir -p %t
2 // RUN: clang-doc --format=html --doxygen --output=%t --executor=standalone %s
3 // RUN: clang-doc --format=md --doxygen --output=%t --executor=standalone %s
4 // RUN: FileCheck %s < %t/GlobalNamespace/index.html --check-prefix=HTML-INDEX-LINE
5 // RUN: FileCheck %s < %t/GlobalNamespace/index.html --check-prefix=HTML-INDEX
6 // RUN: FileCheck %s < %t/GlobalNamespace/Animals.html --check-prefix=HTML-ANIMAL-LINE
7 // RUN: FileCheck %s < %t/GlobalNamespace/Animals.html --check-prefix=HTML-ANIMAL
8 // RUN: FileCheck %s < %t/Vehicles/index.html --check-prefix=HTML-VEHICLES-LINE
9 // RUN: FileCheck %s < %t/Vehicles/index.html --check-prefix=HTML-VEHICLES
10 // RUN: FileCheck %s < %t/GlobalNamespace/index.md --check-prefix=MD-INDEX-LINE
11 // RUN: FileCheck %s < %t/GlobalNamespace/index.md --check-prefix=MD-INDEX
12 // RUN: FileCheck %s < %t/GlobalNamespace/Animals.md --check-prefix=MD-ANIMAL-LINE
13 // RUN: FileCheck %s < %t/GlobalNamespace/Animals.md --check-prefix=MD-ANIMAL
14 // RUN: FileCheck %s < %t/Vehicles/index.md --check-prefix=MD-VEHICLES-LINE
15 // RUN: FileCheck %s < %t/Vehicles/index.md --check-prefix=MD-VEHICLES
19 * @brief For specifying RGB colors
22 // MD-INDEX-LINE: *Defined at {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}enum.cpp#[[@LINE-1]]*
23 // HTML-INDEX-LINE: <p>Defined at line [[@LINE-2]] of file {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}enum.cpp</p>
30 // MD-INDEX: | enum Color |
33 // MD-INDEX: | Green |
35 // MD-INDEX: **brief** For specifying RGB colors
37 // HTML-INDEX: <th colspan="3">enum Color</th>
38 // HTML-INDEX: <td>Red</td>
39 // HTML-INDEX: <td>0</td>
40 // HTML-INDEX: <p> Comment 1</p>
41 // HTML-INDEX: <td>Green</td>
42 // HTML-INDEX: <td>1</td>
43 // HTML-INDEX: <p> Comment 2</p>
44 // HTML-INDEX: <td>Blue</td>
45 // HTML-INDEX: <td>2</td>
46 // HTML-INDEX: <p> Comment 3</p>
52 // MD-INDEX-LINE: *Defined at {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}enum.cpp#[[@LINE-1]]*
53 // HTML-INDEX-LINE: <p>Defined at line [[@LINE-2]] of file {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}enum.cpp</p>
62 // MD-INDEX: | enum class Shapes |
64 // MD-INDEX: | Circle |
65 // MD-INDEX: | Rectangle |
66 // MD-INDEX: | Triangle |
67 // MD-INDEX: **brief** Shape Types
69 // HTML-INDEX: <th colspan="3">enum class Shapes</th>
70 // HTML-INDEX: <td>Circle</td>
71 // HTML-INDEX: <td>0</td>
72 // HTML-INDEX: <p> Comment 1</p>
73 // HTML-INDEX: <td>Rectangle</td>
74 // HTML-INDEX: <td>1</td>
75 // HTML-INDEX: <p> Comment 2</p>
76 // HTML-INDEX: <td>Triangle</td>
77 // HTML-INDEX: <td>2</td>
78 // HTML-INDEX: <p> Comment 3</p>
83 // MD-ANIMAL-LINE: *Defined at {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}enum.cpp#[[@LINE-1]]*
84 // HTML-ANIMAL-LINE: <p>Defined at line [[@LINE-2]] of file {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}enum.cpp</p>
87 * @brief specify what animal the class is
90 // MD-ANIMAL-LINE: *Defined at {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}enum.cpp#[[@LINE-1]]*
91 // HTML-ANIMAL-LINE: <p>Defined at line [[@LINE-2]] of file {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}enum.cpp</p>
92 Dog
, ///< Man's best friend
93 Cat
, ///< Man's other best friend
98 // HTML-ANIMAL: <h1>class Animals</h1>
99 // HTML-ANIMAL: <h2 id="Enums">Enums</h2>
100 // HTML-ANIMAL: <th colspan="3">enum AnimalType</th>
101 // HTML-ANIMAL: <td>Dog</td>
102 // HTML-ANIMAL: <td>0</td>
103 // HTML-ANIMAL: <p> Man's best friend</p>
104 // HTML-ANIMAL: <td>Cat</td>
105 // HTML-ANIMAL: <td>1</td>
106 // HTML-ANIMAL: <p> Man's other best friend</p>
107 // HTML-ANIMAL: <td>Iguana</td>
108 // HTML-ANIMAL: <td>2</td>
109 // HTML-ANIMAL: <p> A lizard</p>
112 // MD-ANIMAL: # class Animals
113 // MD-ANIMAL: ## Enums
114 // MD-ANIMAL: | enum AnimalType |
116 // MD-ANIMAL: | Dog |
117 // MD-ANIMAL: | Cat |
118 // MD-ANIMAL: | Iguana |
119 // MD-ANIMAL: **brief** specify what animal the class is
124 * @brief specify type of car
127 // MD-VEHICLES-LINE: *Defined at {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}enum.cpp#[[@LINE-1]]*
128 // HTML-VEHICLES-LINE: <p>Defined at line [[@LINE-2]] of file {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}enum.cpp</p>
130 Sedan
, ///< Comment 1
132 Pickup
, ///< Comment 3
133 Hatchback
///< Comment 4
137 // MD-VEHICLES: # namespace Vehicles
138 // MD-VEHICLES: ## Enums
139 // MD-VEHICLES: | enum Car |
141 // MD-VEHICLES: | Sedan |
142 // MD-VEHICLES: | SUV |
143 // MD-VEHICLES: | Pickup |
144 // MD-VEHICLES: | Hatchback |
145 // MD-VEHICLES: **brief** specify type of car
147 // HTML-VEHICLES: <h1>namespace Vehicles</h1>
148 // HTML-VEHICLES: <th colspan="3">enum Car</th>
149 // HTML-VEHICLES: <td>Sedan</td>
150 // HTML-VEHICLES: <td>0</td>
151 // HTML-VEHICLES: <p> Comment 1</p>
152 // HTML-VEHICLES: <td>SUV</td>
153 // HTML-VEHICLES: <td>1</td>
154 // HTML-VEHICLES: <p> Comment 2</p>
155 // HTML-VEHICLES: <td>Pickup</td>
156 // HTML-VEHICLES: <td>2</td>
157 // HTML-VEHICLES: <p> Comment 3</p>
158 // HTML-VEHICLES: <td>Hatchback</td>
159 // HTML-VEHICLES: <td>3</td>
160 // HTML-VEHICLES: <p> Comment 4</p>
163 enum ColorUserSpecified
{
164 RedUserSpecified
= 'A',
165 GreenUserSpecified
= 2,
166 BlueUserSpecified
= 'C'
169 // MD-INDEX: | enum ColorUserSpecified |
171 // MD-INDEX: | RedUserSpecified |
172 // MD-INDEX: | GreenUserSpecified |
173 // MD-INDEX: | BlueUserSpecified |
175 // HTML-INDEX: <th colspan="2">enum ColorUserSpecified</th>
176 // HTML-INDEX: <td>RedUserSpecified</td>
177 // HTML-INDEX: <td>'A'</td>
178 // HTML-INDEX: <td>GreenUserSpecified</td>
179 // HTML-INDEX: <td>2</td>
180 // HTML-INDEX: <td>BlueUserSpecified</td>
181 // HTML-INDEX: <td>'C'</td>