// RUN: rm -rf %t && mkdir -p %t // 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-LINE // RUN: FileCheck %s < %t/GlobalNamespace/index.html --check-prefix=HTML-INDEX // RUN: FileCheck %s < %t/GlobalNamespace/Animals.html --check-prefix=HTML-ANIMAL-LINE // RUN: FileCheck %s < %t/GlobalNamespace/Animals.html --check-prefix=HTML-ANIMAL // RUN: FileCheck %s < %t/Vehicles/index.html --check-prefix=HTML-VEHICLES-LINE // RUN: FileCheck %s < %t/Vehicles/index.html --check-prefix=HTML-VEHICLES // RUN: FileCheck %s < %t/GlobalNamespace/index.md --check-prefix=MD-INDEX-LINE // RUN: FileCheck %s < %t/GlobalNamespace/index.md --check-prefix=MD-INDEX // RUN: FileCheck %s < %t/GlobalNamespace/Animals.md --check-prefix=MD-ANIMAL-LINE // RUN: FileCheck %s < %t/GlobalNamespace/Animals.md --check-prefix=MD-ANIMAL // RUN: FileCheck %s < %t/Vehicles/index.md --check-prefix=MD-VEHICLES-LINE // RUN: FileCheck %s < %t/Vehicles/index.md --check-prefix=MD-VEHICLES /** * @brief For specifying RGB colors */ enum Color { // MD-INDEX-LINE: *Defined at {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}enum.cpp#[[@LINE-1]]* // HTML-INDEX-LINE:
Defined at line [[@LINE-2]] of file {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}enum.cpp
Red, ///< Comment 1 Green, ///< Comment 2 Blue ///< Comment 3 }; // MD-INDEX: ## Enums // MD-INDEX: | enum Color | // MD-INDEX: -- // MD-INDEX: | Red | // MD-INDEX: | Green | // MD-INDEX: | Blue | // MD-INDEX: **brief** For specifying RGB colors // HTML-INDEX:Comment 1
// HTML-INDEX:Comment 2
// HTML-INDEX:Comment 3
/** * @brief Shape Types */ enum class Shapes { // MD-INDEX-LINE: *Defined at {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}enum.cpp#[[@LINE-1]]* // HTML-INDEX-LINE:Defined at line [[@LINE-2]] of file {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}enum.cpp
/// Comment 1 Circle, /// Comment 2 Rectangle, /// Comment 3 Triangle }; // MD-INDEX: | enum class Shapes | // MD-INDEX: -- // MD-INDEX: | Circle | // MD-INDEX: | Rectangle | // MD-INDEX: | Triangle | // MD-INDEX: **brief** Shape Types // HTML-INDEX:Comment 1
// HTML-INDEX:Comment 2
// HTML-INDEX:Comment 3
class Animals { // MD-ANIMAL-LINE: *Defined at {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}enum.cpp#[[@LINE-1]]* // HTML-ANIMAL-LINE:Defined at line [[@LINE-2]] of file {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}enum.cpp
public: /** * @brief specify what animal the class is */ enum AnimalType { // MD-ANIMAL-LINE: *Defined at {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}enum.cpp#[[@LINE-1]]* // HTML-ANIMAL-LINE:Defined at line [[@LINE-2]] of file {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}enum.cpp
Dog, ///< Man's best friend Cat, ///< Man's other best friend Iguana ///< A lizard }; }; // HTML-ANIMAL:Man's best friend
// HTML-ANIMAL:Man's other best friend
// HTML-ANIMAL:A lizard
// MD-ANIMAL: # class Animals // MD-ANIMAL: ## Enums // MD-ANIMAL: | enum AnimalType | // MD-ANIMAL: -- // MD-ANIMAL: | Dog | // MD-ANIMAL: | Cat | // MD-ANIMAL: | Iguana | // MD-ANIMAL: **brief** specify what animal the class is namespace Vehicles { /** * @brief specify type of car */ enum Car { // MD-VEHICLES-LINE: *Defined at {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}enum.cpp#[[@LINE-1]]* // HTML-VEHICLES-LINE:Defined at line [[@LINE-2]] of file {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}enum.cpp
Sedan, ///< Comment 1 SUV, ///< Comment 2 Pickup, ///< Comment 3 Hatchback ///< Comment 4 }; } // 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: **brief** specify type of car // HTML-VEHICLES:Comment 1
// HTML-VEHICLES:Comment 2
// HTML-VEHICLES:Comment 3
// HTML-VEHICLES:Comment 4
enum ColorUserSpecified { RedUserSpecified = 'A', GreenUserSpecified = 2, BlueUserSpecified = 'C' }; // MD-INDEX: | enum ColorUserSpecified | // MD-INDEX: -- // MD-INDEX: | RedUserSpecified | // MD-INDEX: | GreenUserSpecified | // MD-INDEX: | BlueUserSpecified | // HTML-INDEX: