diff --git a/clang-tools-extra/test/clang-doc/basic-project.test b/clang-tools-extra/test/clang-doc/basic-project.test index 1f5ba8bdc0703..9a28287e0e060 100644 --- a/clang-tools-extra/test/clang-doc/basic-project.test +++ b/clang-tools-extra/test/clang-doc/basic-project.test @@ -1,11 +1,19 @@ // 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 --repository=https://repository.com +// 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-prefix=HTML-SHAPE -// RUN: FileCheck %s -input-file=%t/docs/GlobalNamespace/Calculator.html -check-prefix=HTML-CALC -// RUN: FileCheck %s -input-file=%t/docs/GlobalNamespace/Rectangle.html -check-prefix=HTML-RECTANGLE -// RUN: FileCheck %s -input-file=%t/docs/GlobalNamespace/Circle.html -check-prefix=HTML-CIRCLE +// RUN: FileCheck %s -input-file=%t/docs/GlobalNamespace/Shape.html -check-prefixes=HTML-SHAPE,SHAPE-NO-REPOSITORY +// RUN: FileCheck %s -input-file=%t/docs/GlobalNamespace/Calculator.html -check-prefixes=HTML-CALC,CALC-NO-REPOSITORY +// RUN: FileCheck %s -input-file=%t/docs/GlobalNamespace/Rectangle.html -check-prefixes=HTML-RECTANGLE,RECTANGLE-NO-REPOSITORY +// RUN: FileCheck %s -input-file=%t/docs/GlobalNamespace/Circle.html -check-prefixes=HTML-CIRCLE,CIRCLE-NO-REPOSITORY + +// RUN: clang-doc --format=html --output=%t/docs --executor=all-TUs %t/build/compile_commands.json --repository=https://repository.com +// RUN: FileCheck %s -input-file=%t/docs/index_json.js -check-prefixes=JSON-INDEX +// RUN: FileCheck %s -input-file=%t/docs/GlobalNamespace/Shape.html -check-prefixes=HTML-SHAPE,SHAPE-REPOSITORY +// RUN: FileCheck %s -input-file=%t/docs/GlobalNamespace/Calculator.html -check-prefixes=HTML-CALC,CALC-REPOSITORY +// 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 + // JSON-INDEX: async function LoadIndex() { // JSON-INDEX-NEXT: return{ @@ -55,12 +63,13 @@ // JSON-INDEX-NEXT: } // HTML-SHAPE:
-// HTML-SHAPE-NEXT: Defined at line -// HTML-SHAPE-NEXT: 8 -// HTML-SHAPE-NEXT: of file -// HTML-SHAPE-NEXT: Shape.h -// HTML-SHAPE-NEXT:
+// SHAPE-NO-REPOSITORY:Defined at line 8 of file .{{.}}include{{.}}Shape.h
+// SHAPE-REPOSITORY:+// SHAPE-REPOSITORY-NEXT: Defined at line +// SHAPE-REPOSITORY-NEXT: 8 +// SHAPE-REPOSITORY-NEXT: of file +// SHAPE-REPOSITORY-NEXT: Shape.h +// SHAPE-REPOSITORY-NEXT:
// HTML-SHAPE:Abstract base class for shapes.
// HTML-SHAPE:Provides a common interface for different types of shapes.
@@ -77,60 +86,72 @@ // HTML-SHAPE:double The perimeter of the shape.
// HTML-SHAPE:public void ~Shape()
-// HTML-SHAPE: Defined at line -// HTML-SHAPE-NEXT: 13 -// HTML-SHAPE-NEXT: of file -// HTML-SHAPE-NEXT: Shape.h + +// SHAPE-NO-REPOSITORY: Defined at line 13 of file .{{.}}include{{.}}Shape.h +// SHAPE-REPOSITORY: Defined at line +// SHAPE-REPOSITORY-NEXT: 13 +// SHAPE-REPOSITORY-NEXT: of file +// SHAPE-REPOSITORY-NEXT: Shape.h + // HTML-SHAPE:Virtual destructor.
// HTML-CALC:-// HTML-CALC-NEXT: Defined at line -// HTML-CALC-NEXT: 8 -// HTML-CALC-NEXT: of file -// HTML-CALC-NEXT: Calculator.h -// HTML-CALC-NEXT:
+// CALC-NO-REPOSITORY:Defined at line 8 of file .{{.}}include{{.}}Calculator.h
+// CALC-REPOSITORY:+// CALC-REPOSITORY-NEXT: Defined at line +// CALC-REPOSITORY-NEXT: 8 +// CALC-REPOSITORY-NEXT: of file +// CALC-REPOSITORY-NEXT: Calculator.h +// CALC-REPOSITORY-NEXT:
// HTML-CALC:A simple calculator class.
// HTML-CALC:Provides basic arithmetic operations.
// HTML-CALC:public int add(int a, int b)
-// HTML-CALC: Defined at line -// HTML-CALC-NEXT: 3 -// HTML-CALC-NEXT: of file -// HTML-CALC-NEXT: Calculator.cpp +// CALC-NO-REPOSITORY: Defined at line 3 of file .{{.}}src{{.}}Calculator.cpp +// CALC-REPOSITORY: Defined at line +// CALC-REPOSITORY-NEXT: 3 +// CALC-REPOSITORY-NEXT: of file +// CALC-REPOSITORY-NEXT: Calculator.cpp + // HTML-CALC:Adds two integers.
// HTML-CALC:int The sum of a and b.
// HTML-CALC:public int subtract(int a, int b)
-// HTML-CALC: Defined at line -// HTML-CALC-NEXT: 7 -// HTML-CALC-NEXT: of file -// HTML-CALC-NEXT: Calculator.cpp +// CALC-NO-REPOSITORY: Defined at line 7 of file .{{.}}src{{.}}Calculator.cpp +// CALC-REPOSITORY: Defined at line +// CALC-REPOSITORY-NEXT: 7 +// CALC-REPOSITORY-NEXT: of file +// CALC-REPOSITORY-NEXT: Calculator.cpp + // HTML-CALC:Subtracts the second integer from the first.
// HTML-CALC:int The result of a - b.
// HTML-CALC:public int multiply(int a, int b)
-// HTML-CALC: Defined at line -// HTML-CALC-NEXT: 11 -// HTML-CALC-NEXT: of file -// HTML-CALC-NEXT: Calculator.cpp +// CALC-NO-REPOSITORY: Defined at line 11 of file .{{.}}src{{.}}Calculator.cpp +// CALC-REPOSITORY: Defined at line +// CALC-REPOSITORY-NEXT: 11 +// CALC-REPOSITORY-NEXT: of file +// CALC-REPOSITORY-NEXT: Calculator.cpp + // HTML-CALC:Multiplies two integers.
// HTML-CALC:int The product of a and b.
// HTML-CALC:public double divide(int a, int b)
-// HTML-CALC: Defined at line -// HTML-CALC-NEXT: 15 -// HTML-CALC-NEXT: of file -// HTML-CALC-NEXT: Calculator.cpp +// CALC-NO-REPOSITORY: Defined at line 15 of file .{{.}}src{{.}}Calculator.cpp +// CALC-REPOSITORY: Defined at line +// CALC-REPOSITORY-NEXT: 15 +// CALC-REPOSITORY-NEXT: of file +// CALC-REPOSITORY-NEXT: Calculator.cpp + // HTML-CALC:Divides the first integer by the second.
// HTML-CALC:if b is zero.
// HTML-RECTANGLE:-// HTML-RECTANGLE-NEXT: Defined at line -// HTML-RECTANGLE-NEXT: 10 -// HTML-RECTANGLE-NEXT: of file -// HTML-RECTANGLE-NEXT: Rectangle.h -// HTML-RECTANGLE-NEXT:
+// RECTANGLE-NO-REPOSITORY:Defined at line 10 of file .{{.}}include{{.}}Rectangle.h
+// RECTANGLE-REPOSITORY:+// RECTANGLE-REPOSITORY-NEXT: Defined at line +// RECTANGLE-REPOSITORY-NEXT: 10 +// RECTANGLE-REPOSITORY-NEXT: of file +// RECTANGLE-REPOSITORY-NEXT: Rectangle.h +// RECTANGLE-REPOSITORY-NEXT:
+ // HTML-RECTANGLE:Represents a rectangle with a given width and height.
// HTML-RECTANGLE:// HTML-RECTANGLE: Inherits from @@ -158,40 +181,47 @@ // HTML-RECTANGLE:
public void Rectangle(double width, double height)
-// HTML-RECTANGLE: Defined at line -// HTML-RECTANGLE-NEXT: 3 -// HTML-RECTANGLE-NEXT: of file -// HTML-RECTANGLE-NEXT: Rectangle.cpp +// RECTANGLE-NO-REPOSITORY: Defined at line 3 of file .{{.}}src{{.}}Rectangle.cpp +// RECTANGLE-REPOSITORY: Defined at line +// RECTANGLE-REPOSITORY-NEXT: 3 +// RECTANGLE-REPOSITORY-NEXT: of file +// RECTANGLE-REPOSITORY-NEXT: Rectangle.cpp + // HTML-RECTANGLE:Constructs a new Rectangle object.
// HTML-RECTANGLE:public double area()
-// HTML-RECTANGLE: Defined at line -// HTML-RECTANGLE-NEXT: 6 -// HTML-RECTANGLE-NEXT: of file -// HTML-RECTANGLE-NEXT: Rectangle.cpp +// RECTANGLE-NO-REPOSITORY: Defined at line 6 of file .{{.}}src{{.}}Rectangle.cpp +// RECTANGLE-REPOSITORY: Defined at line +// RECTANGLE-REPOSITORY-NEXT: 6 +// RECTANGLE-REPOSITORY-NEXT: of file +// RECTANGLE-REPOSITORY-NEXT: Rectangle.cpp + // HTML-RECTANGLE:Calculates the area of the rectangle.
// HTML-RECTANGLE:double The area of the rectangle.
// HTML-RECTANGLE:public double perimeter()
-// HTML-RECTANGLE: Defined at line -// HTML-RECTANGLE-NEXT: 10 -// HTML-RECTANGLE-NEXT: of file -// HTML-RECTANGLE-NEXT: Rectangle.cpp +// RECTANGLE-NO-REPOSITORY: Defined at line 10 of file .{{.}}src{{.}}Rectangle.cpp +// RECTANGLE-REPOSITORY: Defined at line +// RECTANGLE-REPOSITORY-NEXT: 10 +// RECTANGLE-REPOSITORY-NEXT: of file +// RECTANGLE-REPOSITORY-NEXT: Rectangle.cpp // HTML-RECTANGLE:Calculates the perimeter of the rectangle.
// HTML-RECTANGLE:double The perimeter of the rectangle.
// HTML-CIRCLE:-// HTML-CIRCLE-NEXT: Defined at line -// HTML-CIRCLE-NEXT: 10 -// HTML-CIRCLE-NEXT: of file -// HTML-CIRCLE-NEXT: Circle.h -// HTML-CIRCLE-NEXT:
+// CIRCLE-NO-REPOSITORY:Defined at line 10 of file .{{.}}include{{.}}Circle.h
+// CIRCLE-REPOSITORY:+// CIRCLE-REPOSITORY-NEXT: Defined at line +// CIRCLE-REPOSITORY-NEXT: 10 +// CIRCLE-REPOSITORY-NEXT: of file +// CIRCLE-REPOSITORY-NEXT: Circle.h +// CIRCLE-REPOSITORY-NEXT:
+ // HTML-CIRCLE:Circle class derived from Shape.
// HTML-CIRCLE:Represents a circle with a given radius.
@@ -205,28 +235,34 @@ // HTML-CIRCLE:public void Circle(double radius)
-// HTML-CIRCLE: Defined at line -// HTML-CIRCLE-NEXT: 3 -// HTML-CIRCLE-NEXT: of file -// HTML-CIRCLE-NEXT: Circle.cpp +// CIRCLE-NO-REPOSITORY: Defined at line 3 of file .{{.}}src{{.}}Circle.cpp +// CIRCLE-REPOSITORY: Defined at line +// CIRCLE-REPOSITORY-NEXT: 3 +// CIRCLE-REPOSITORY-NEXT: of file +// CIRCLE-REPOSITORY-NEXT: Circle.cpp + // HTML-CIRCLE:Constructs a new Circle object.
// HTML-CIRCLE:public double area()
-// HTML-CIRCLE: Defined at line -// HTML-CIRCLE-NEXT: 5 -// HTML-CIRCLE-NEXT: of file -// HTML-CIRCLE-NEXT: Circle.cpp +// CIRCLE-NO-REPOSITORY: Defined at line 5 of file .{{.}}src{{.}}Circle.cpp +// CIRCLE-REPOSITORY: Defined at line +// CIRCLE-REPOSITORY-NEXT: 5 +// CIRCLE-REPOSITORY-NEXT: of file +// CIRCLE-REPOSITORY-NEXT: Circle.cpp + // HTML-CIRCLE:Calculates the area of the circle.
// HTML-CIRCLE:double The area of the circle.
// HTML-CIRCLE:public double perimeter()
-// HTML-CIRCLE: Defined at line -// HTML-CIRCLE-NEXT: 9 -// HTML-CIRCLE-NEXT: of file -// HTML-CIRCLE-NEXT: Circle.cpp +// CIRCLE-NO-REPOSITORY: Defined at line 9 of file .{{.}}src{{.}}Circle.cpp +// CIRCLE-REPOSITORY: Defined at line +// CIRCLE-REPOSITORY-NEXT: 9 +// CIRCLE-REPOSITORY-NEXT: of file +// CIRCLE-REPOSITORY-NEXT: Circle.cpp + // HTML-CIRCLE:Calculates the perimeter of the circle.
// HTML-CIRCLE: