diff --git a/clang-tools-extra/test/clang-doc/enum.cpp b/clang-tools-extra/test/clang-doc/enum.cpp index fcc05477903ff7..1e574a9b2b8f46 100644 --- a/clang-tools-extra/test/clang-doc/enum.cpp +++ b/clang-tools-extra/test/clang-doc/enum.cpp @@ -2,24 +2,13 @@ // RUN: clang-doc --format=html --doxygen --output=%t --executor=standalone %s // RUN: clang-doc --format=md --doxygen --output=%t --executor=standalone %s // RUN: FileCheck %s < %t/GlobalNamespace/index.html -check-prefix=HTML-INDEX +// RUN: FileCheck %s < %t/GlobalNamespace/Animals.html -check-prefix=HTML-ANIMAL +// RUN: FileCheck %s < %t/Vehicles/index.html -check-prefix=HTML-VEHICLES // RUN: FileCheck %s < %t/GlobalNamespace/index.md -check-prefix=MD-INDEX +// RUN: FileCheck %s < %t/GlobalNamespace/Animals.md -check-prefix=MD-ANIMAL +// RUN: FileCheck %s < %t/Vehicles/index.md -check-prefix=MD-VEHICLES -/** - * @brief For specifying RGB colors - */ -enum Color { - Red, - Green, - Blue -}; -// HTML-INDEX:
Defined at line 10 of file {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}enum.cpp
// MD-INDEX: # Global Namespace // MD-INDEX: ## Enums @@ -28,5 +17,112 @@ enum Color { // MD-INDEX: | Red | // MD-INDEX: | Green | // MD-INDEX: | Blue | -// MD-INDEX: *Defined at {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}enum.cpp#10* -// MD-INDEX: **brief** For specifying RGB colors \ No newline at end of file +// MD-INDEX: *Defined at {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}enum.cpp#[[@LINE+13]]* +// MD-INDEX: **brief** For specifying RGB colors + +// HTML-INDEX:Defined at line [[@LINE+4]] of file {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}enum.cpp
+/** + * @brief For specifying RGB colors + */ +enum Color { + Red, ///< Red + Green, ///< Green + Blue ///< Blue +}; + + +// MD-INDEX: | enum class Shapes | +// MD-INDEX: -- +// MD-INDEX: | Circle | +// MD-INDEX: | Rectangle | +// MD-INDEX: | Triangle | +// MD-INDEX: *Defined at {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}enum.cpp#[[@LINE+11]]* +// MD-INDEX: **brief** Shape Types + +// HTML-INDEX:Defined at line [[@LINE+4]] of file {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}enum.cpp
+/** + * @brief Shape Types + */ +enum class Shapes { + /// Circle + Circle, + /// Rectangle + Rectangle, + /// Triangle + Triangle +}; + + +// MD-ANIMAL: # class Animals +// MD-ANIMAL: *Defined at {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}enum.cpp#[[@LINE+18]]* +// MD-ANIMAL: ## Enums +// MD-ANIMAL: | enum AnimalType | +// MD-ANIMAL: -- +// MD-ANIMAL: | Dog | +// MD-ANIMAL: | Cat | +// MD-ANIMAL: | Iguana | +// MD-ANIMAL: *Defined at {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}enum.cpp#[[@LINE+16]]* +// MD-ANIMAL: **brief** specify what animal the class is + +// HTML-ANIMAL:Defined at line [[@LINE+7]] of file {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}enum.cpp
+// HTML-ANIMAL:Defined at line [[@LINE+6]] of file {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}enum.cpp
+class Animals { +public: + /** + * @brief specify what animal the class is + */ + enum AnimalType { + Dog, /// Man's best friend + Cat, /// Man's other best friend + Iguana /// A lizard + }; +}; + + + +// MD-VEHICLES: # namespace Vehicles +// MD-VEHICLES: ## Enums +// MD-VEHICLES: | enum Car | +// MD-VEHICLES: -- +// MD-VEHICLES: | Sedan | +// MD-VEHICLES: | SUV | +// MD-VEHICLES: | Pickup | +// MD-VEHICLES: | Hatchback | +// MD-VEHICLES: *Defined at {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}enum.cpp#[[@LINE+15]]* +// MD-VEHICLES: **brief** specify type of car + +// HTML-VEHICLES:Defined at line [[@LINE+5]] of file {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}enum.cpp
+namespace Vehicles { + /** + * @brief specify type of car + */ + enum Car { + Sedan, /// Sedan + SUV, /// SUV + Pickup, /// Pickup + Hatchback /// Hatchback + }; +} \ No newline at end of file