From ec796d676705b9b4152931137852df71a0ccc265 Mon Sep 17 00:00:00 2001 From: PeterChou1 Date: Mon, 15 Jul 2024 17:53:57 -0400 Subject: [PATCH] [clang-doc] update test to use @line directive --- clang-tools-extra/test/clang-doc/enum.cpp | 159 +++++++++++----------- 1 file changed, 83 insertions(+), 76 deletions(-) diff --git a/clang-tools-extra/test/clang-doc/enum.cpp b/clang-tools-extra/test/clang-doc/enum.cpp index e9e912aebd8dbf..6aa8acd8d3ad28 100644 --- a/clang-tools-extra/test/clang-doc/enum.cpp +++ b/clang-tools-extra/test/clang-doc/enum.cpp @@ -9,105 +9,92 @@ // RUN: FileCheck %s < %t/Vehicles/index.md -check-prefix=MD-VEHICLES + +// MD-INDEX: # Global Namespace +// MD-INDEX: ## Enums +// MD-INDEX: | enum Color | +// MD-INDEX: -- +// MD-INDEX: | Red | +// MD-INDEX: | Green | +// MD-INDEX: | Blue | +// MD-INDEX: *Defined at {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}enum.cpp#[[@LINE+13]]* +// MD-INDEX: **brief** For specifying RGB colors + +// 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 [[@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 + Red, ///< Red + Green, ///< Green + Blue ///< Blue }; + +// MD-INDEX: | enum Shapes | +// MD-INDEX: -- +// MD-INDEX: | Circle | +// MD-INDEX: | Rectangle | +// MD-INDEX: | Triangle | +// MD-INDEX: *Defined at A:\clion-llvm\llvm-project\clang-tools-extra\test\clang-doc\enum.cpp#[[@LINE+11]]* +// MD-INDEX: **brief** Shape Types + +// HTML-INDEX:

    enum Shapes

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

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

    /** * @brief Shape Types */ enum Shapes { - // Circle + /// Circle Circle, - // Rectangle + /// Rectangle Rectangle, - // Triangle + /// 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 {{.*}} 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 -// MD-INDEX: | enum Color | -// MD-INDEX: -- -// MD-INDEX: | Red | -// MD-INDEX: | Green | -// MD-INDEX: | Blue | -// 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: *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#{{.*}}* +// 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:

    class Animals

    +// HTML-ANIMAL:

    Defined at line [[@LINE+7]] 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 [[@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 @@ -117,5 +104,25 @@ namespace Vehicles { // 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 +// MD-VEHICLES: *Defined at {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}enum.cpp#[[@LINE+15]]* +// MD-VEHICLES: **brief** specify type of car + +// 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 [[@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