Skip to content

[clang-doc] Enable MD tests in basic-project #131924

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 19, 2025

Conversation

ilovepi
Copy link
Contributor

@ilovepi ilovepi commented Mar 18, 2025

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.

@ilovepi ilovepi requested review from PeterChou1 and petrhosek March 18, 2025 22:00
@ilovepi ilovepi marked this pull request as ready for review March 18, 2025 22:00
@llvmbot
Copy link
Member

llvmbot commented Mar 18, 2025

@llvm/pr-subscribers-clang-tools-extra

Author: Paul Kirth (ilovepi)

Changes

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.


Full diff: https://github.com/llvm/llvm-project/pull/131924.diff

1 Files Affected:

  • (modified) clang-tools-extra/test/clang-doc/basic-project.test (+12-4)
diff --git a/clang-tools-extra/test/clang-doc/basic-project.test b/clang-tools-extra/test/clang-doc/basic-project.test
index 9a28287e0e060..11beb7660040d 100644
--- a/clang-tools-extra/test/clang-doc/basic-project.test
+++ b/clang-tools-extra/test/clang-doc/basic-project.test
@@ -1,5 +1,6 @@
 // RUN: rm -rf %t && mkdir -p %t/docs %t/build
 // RUN: sed 's|$test_dir|%/S|g' %S/Inputs/basic-project/database_template.json > %t/build/compile_commands.json
+
 // RUN: clang-doc --format=html --output=%t/docs --executor=all-TUs %t/build/compile_commands.json
 // RUN: FileCheck %s -input-file=%t/docs/index_json.js -check-prefix=JSON-INDEX
 // RUN: FileCheck %s -input-file=%t/docs/GlobalNamespace/Shape.html -check-prefixes=HTML-SHAPE,SHAPE-NO-REPOSITORY
@@ -14,6 +15,13 @@
 // RUN: FileCheck %s -input-file=%t/docs/GlobalNamespace/Rectangle.html -check-prefixes=HTML-RECTANGLE,RECTANGLE-REPOSITORY
 // RUN: FileCheck %s -input-file=%t/docs/GlobalNamespace/Circle.html -check-prefixes=HTML-CIRCLE,CIRCLE-REPOSITORY
 
+// RUN: clang-doc --format=md --output=%t/docs --executor=all-TUs %t/build/compile_commands.json
+// RUN: FileCheck %s -input-file=%t/docs/all_files.md -check-prefixes=MD-ALL-FILES
+// RUN: FileCheck %s -input-file=%t/docs/index.md -check-prefixes=MD-INDEX
+// RUN: FileCheck %s -input-file=%t/docs/GlobalNamespace/Shape.md -check-prefixes=MD-SHAPE
+// RUN: FileCheck %s -input-file=%t/docs/GlobalNamespace/Calculator.md -check-prefixes=MD-CALC
+// RUN: FileCheck %s -input-file=%t/docs/GlobalNamespace/Rectangle.md -check-prefixes=MD-RECTANGLE
+// RUN: FileCheck %s -input-file=%t/docs/GlobalNamespace/Circle.md -check-prefixes=MD-CIRCLE
 
 // JSON-INDEX: async function LoadIndex() {
 // JSON-INDEX-NEXT: return{
@@ -358,10 +366,6 @@
 // MD-SHAPE: **brief** Abstract base class for shapes.
 // MD-SHAPE:  Provides a common interface for different types of shapes.
 // MD-SHAPE: ## Functions
-// MD-SHAPE: ### ~Shape
-// MD-SHAPE: *public void ~Shape()*
-// MD-SHAPE: *Defined at .{{[\/]}}include{{[\/]}}Shape.h#13*
-// MD-SHAPE: **brief** Virtual destructor.
 // MD-SHAPE: ### area
 // MD-SHAPE: *public double area()*
 // MD-SHAPE: **brief** Calculates the area of the shape.
@@ -370,6 +374,10 @@
 // MD-SHAPE: *public double perimeter()*
 // MD-SHAPE: **brief** Calculates the perimeter of the shape.
 // MD-SHAPE: **return** double The perimeter of the shape.
+// MD-SHAPE: ### ~Shape
+// MD-SHAPE: *public void ~Shape()*
+// MD-SHAPE: *Defined at .{{[\/]}}include{{[\/]}}Shape.h#13*
+// MD-SHAPE: **brief** Virtual destructor.
 
 // MD-ALL-FILES: # All Files
 // MD-ALL-FILES: ## [GlobalNamespace](GlobalNamespace{{[\/]}}index.md)

Base automatically changed from users/ilovepi/clang-doc-repository to main March 19, 2025 15:24
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.
Copy link
Contributor Author

ilovepi commented Mar 19, 2025

Merge activity

  • Mar 19, 7:13 PM EDT: A user started a stack merge that includes this pull request via Graphite.
  • Mar 19, 7:14 PM EDT: A user merged this pull request with Graphite.

@ilovepi ilovepi merged commit 77ac5a2 into main Mar 19, 2025
11 checks passed
@ilovepi ilovepi deleted the users/ilovepi/clang-doc-md-test branch March 19, 2025 23:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants