Skip to content

Commit 77ac5a2

Browse files
authored
[clang-doc] Enable MD tests in basic-project (#131924)
For some reason the MD tests don't appear to have ever run, despite having checks. This patch adds a new set of RUN lines that will exercise the markdown generation.
1 parent 09b0e56 commit 77ac5a2

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

clang-tools-extra/test/clang-doc/basic-project.test

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// RUN: rm -rf %t && mkdir -p %t/docs %t/build
22
// RUN: sed 's|$test_dir|%/S|g' %S/Inputs/basic-project/database_template.json > %t/build/compile_commands.json
3+
34
// RUN: clang-doc --format=html --output=%t/docs --executor=all-TUs %t/build/compile_commands.json
45
// RUN: FileCheck %s -input-file=%t/docs/index_json.js -check-prefix=JSON-INDEX
56
// RUN: FileCheck %s -input-file=%t/docs/GlobalNamespace/Shape.html -check-prefixes=HTML-SHAPE,SHAPE-NO-REPOSITORY
@@ -14,6 +15,13 @@
1415
// RUN: FileCheck %s -input-file=%t/docs/GlobalNamespace/Rectangle.html -check-prefixes=HTML-RECTANGLE,RECTANGLE-REPOSITORY
1516
// RUN: FileCheck %s -input-file=%t/docs/GlobalNamespace/Circle.html -check-prefixes=HTML-CIRCLE,CIRCLE-REPOSITORY
1617

18+
// RUN: clang-doc --format=md --output=%t/docs --executor=all-TUs %t/build/compile_commands.json
19+
// RUN: FileCheck %s -input-file=%t/docs/all_files.md -check-prefixes=MD-ALL-FILES
20+
// RUN: FileCheck %s -input-file=%t/docs/index.md -check-prefixes=MD-INDEX
21+
// RUN: FileCheck %s -input-file=%t/docs/GlobalNamespace/Shape.md -check-prefixes=MD-SHAPE
22+
// RUN: FileCheck %s -input-file=%t/docs/GlobalNamespace/Calculator.md -check-prefixes=MD-CALC
23+
// RUN: FileCheck %s -input-file=%t/docs/GlobalNamespace/Rectangle.md -check-prefixes=MD-RECTANGLE
24+
// RUN: FileCheck %s -input-file=%t/docs/GlobalNamespace/Circle.md -check-prefixes=MD-CIRCLE
1725

1826
// JSON-INDEX: async function LoadIndex() {
1927
// JSON-INDEX-NEXT: return{
@@ -358,10 +366,6 @@
358366
// MD-SHAPE: **brief** Abstract base class for shapes.
359367
// MD-SHAPE: Provides a common interface for different types of shapes.
360368
// MD-SHAPE: ## Functions
361-
// MD-SHAPE: ### ~Shape
362-
// MD-SHAPE: *public void ~Shape()*
363-
// MD-SHAPE: *Defined at .{{[\/]}}include{{[\/]}}Shape.h#13*
364-
// MD-SHAPE: **brief** Virtual destructor.
365369
// MD-SHAPE: ### area
366370
// MD-SHAPE: *public double area()*
367371
// MD-SHAPE: **brief** Calculates the area of the shape.
@@ -370,6 +374,10 @@
370374
// MD-SHAPE: *public double perimeter()*
371375
// MD-SHAPE: **brief** Calculates the perimeter of the shape.
372376
// MD-SHAPE: **return** double The perimeter of the shape.
377+
// MD-SHAPE: ### ~Shape
378+
// MD-SHAPE: *public void ~Shape()*
379+
// MD-SHAPE: *Defined at .{{[\/]}}include{{[\/]}}Shape.h#13*
380+
// MD-SHAPE: **brief** Virtual destructor.
373381

374382
// MD-ALL-FILES: # All Files
375383
// MD-ALL-FILES: ## [GlobalNamespace](GlobalNamespace{{[\/]}}index.md)

0 commit comments

Comments
 (0)