diff --git a/clang-tools-extra/test/clang-doc/enum.cpp b/clang-tools-extra/test/clang-doc/enum.cpp index fcc05477903ff7..e9e912aebd8dbf 100644 --- a/clang-tools-extra/test/clang-doc/enum.cpp +++ b/clang-tools-extra/test/clang-doc/enum.cpp @@ -2,24 +2,90 @@ // 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 + Red, // Red + Green, // Green + Blue // Blue +}; + +/** + * @brief Shape Types + */ +enum Shapes { + // Circle + Circle, + // Rectangle + Rectangle, + // Triangle + Triangle +}; + +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 + }; }; + +namespace Vehicles { + /** + * @brief specify type of car + */ + enum Car { + Sedan, // Sedan + SUV, // SUV + Pickup, // Pickup + Hatchback // Hatchback + }; +} + + // HTML-INDEX:

Global Namespace

// HTML-INDEX:

Enums

// HTML-INDEX:

enum Color

// HTML-INDEX:
  • Red
  • // HTML-INDEX:
  • Green
  • // HTML-INDEX:
  • Blue
  • -// HTML-INDEX:

    Defined at line 10 of file {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}enum.cpp

    +// HTML-INDEX:

    Defined at line {{.*}} of file {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}enum.cpp

    +// HTML-INDEX:

    enum Shapes

    +// HTML-INDEX:
  • Circle
  • +// HTML-INDEX:
  • Rectangle
  • +// HTML-INDEX:
  • Triangle
  • +// HTML-INDEX:

    Defined at line {{.*}} of file {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}enum.cpp

    + +// HTML-ANIMAL:

    class Animals

    +// HTML-ANIMAL:

    Defined at line {{.*}} of file {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}enum.cpp

    +// HTML-ANIMAL:

    Enums

    +// HTML-ANIMAL:

    enum AnimalType

    +// HTML-ANIMAL:
  • Dog
  • +// HTML-ANIMAL:
  • Cat
  • +// HTML-ANIMAL:
  • Iguana
  • +// HTML-ANIMAL:

    Defined at line {{.*}} of file {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}enum.cpp

    + +// HTML-VEHICLES:

    namespace Vehicles

    +// HTML-VEHICLES:

    Enums

    +// HTML-VEHICLES:

    enum Car

    +// HTML-VEHICLES:
  • Sedan
  • +// HTML-VEHICLES:
  • SUV
  • +// HTML-VEHICLES:
  • Pickup
  • +// HTML-VEHICLES:
  • Hatchback
  • +// HTML-VEHICLES:

    Defined at line {{.*}} of file {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}enum.cpp

    // MD-INDEX: # Global Namespace // MD-INDEX: ## Enums @@ -28,5 +94,28 @@ 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#{{.*}}* +// MD-INDEX: **brief** For specifying RGB colors + +// MD-ANIMAL: # class Animals +// MD-ANIMAL: *Defined at {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}enum.cpp#{{.*}}* +// 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#{{.*}}* +// MD-ANIMAL: **brief** specify what animal the class is + + +// 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#{{.*}}* +// MD-VEHICLES: **brief** specify type of car \ No newline at end of file