File tree Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change 1+ // Fixes #59819. The underlying problem was fixed in https://reviews.llvm.org/D142560, but this patch adds a proper regression test.
2+ // RUN: rm -rf %t && mkdir -p %t
3+ // RUN: clang-doc --format=md --doxygen --output=%t --executor=standalone %s
4+ // RUN: clang-doc --format=html --doxygen --output=%t --executor=standalone %s
5+ // RUN: FileCheck %s < %t/GlobalNamespace/MyClass.md --check-prefix=MD-MyClass-LINE
6+ // RUN: FileCheck %s < %t/GlobalNamespace/MyClass.md --check-prefix=MD-MyClass
7+ // RUN: FileCheck %s < %t/GlobalNamespace/MyClass.html --check-prefix=HTML-MyClass-LINE
8+ // RUN: FileCheck %s < %t/GlobalNamespace/MyClass.html --check-prefix=HTML-MyClass
9+
10+ #define DECLARE_METHODS \
11+ /* * \
12+ * @brief Declare a method to calculate the sum of two numbers\
13+ */ \
14+ int Add (int a, int b) \
15+ { \
16+ return a + b; \
17+ }
18+
19+ // MD-MyClass: ### Add
20+ // MD-MyClass: *public int Add(int a, int b)*
21+ // MD-MyClass: **brief** Declare a method to calculate the sum of two numbers
22+
23+ // HTML-MyClass: <p>public int Add(int a, int b)</p>
24+ // HTML-MyClass: <div>brief</div>
25+ // HTML-MyClass: <p> Declare a method to calculate the sum of two numbers</p>
26+
27+
28+ class MyClass {
29+ public:
30+ // MD-MyClass-LINE: *Defined at {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}macro.cpp#[[@LINE+2]]*
31+ // HTML-MyClass-LINE: <p>Defined at line [[@LINE+1]] of file {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}macro.cpp</p>
32+ DECLARE_METHODS
33+ };
34+
35+
You can’t perform that action at this time.
0 commit comments