[clang-tools-extra] [llvm] Clang doc test (PR #93928)

Paul Kirth via cfe-commits cfe-commits at lists.llvm.org
Fri May 31 11:46:39 PDT 2024


================
@@ -0,0 +1,370 @@
+// RUN: mkdir -p %T/clang-doc/build
+// RUN: mkdir -p %T/clang-doc/include
+// RUN: mkdir -p %T/clang-doc/src
+// RUN: mkdir -p %T/clang-doc/docs
+// RUN: sed 's|$test_dir|%/T/clang-doc|g' %S/Inputs/clang-doc-project1/database_template.json > %T/clang-doc/build/compile_commands.json
+// RUN: cp %S/Inputs/clang-doc-project1/*.h  %T/clang-doc/include
+// RUN: cp %S/Inputs/clang-doc-project1/*.cpp %T/clang-doc/src
+// RUN: cd %T/clang-doc/build
+// RUN: clang-doc --format=html --executor=all-TUs --output=%T/clang-doc/docs ./compile_commands.json
+// RUN: FileCheck -input-file=%T/clang-doc/docs/index_json.js -check-prefix=CHECK-JSON-INDEX %s
+// RUN: FileCheck -input-file=%T/clang-doc/docs/GlobalNamespace/Shape.html -check-prefix=CHECK-HTML-SHAPE %s
+// RUN: FileCheck -input-file=%T/clang-doc/docs/GlobalNamespace/Calculator.html -check-prefix=CHECK-HTML-CALC %s
+// RUN: FileCheck -input-file=%T/clang-doc/docs/GlobalNamespace/Rectangle.html -check-prefix=CHECK-HTML-RECTANGLE %s
+// RUN: FileCheck -input-file=%T/clang-doc/docs/GlobalNamespace/Circle.html -check-prefix=CHECK-HTML-CIRCLE %s
+
+// CHECK-JSON-INDEX: var JsonIndex = `
+// CHECK-JSON-INDEX: {
+// CHECK-JSON-INDEX:   "USR": "{{([0-9A-F]{40})}}",
----------------
ilovepi wrote:

If you expect lines after the first match to be sequential, then use `CHECK-NEXT` (in this case `CHECK-JSON-INDEX-NEXT`) to make sure that the matches re in order.

https://github.com/llvm/llvm-project/pull/93928


More information about the cfe-commits mailing list