[clang-tools-extra] [llvm] [clang][clang-doc] Add basic e2e test to clang-doc (PR #93928)

Paul Kirth via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 6 14:00:41 PDT 2024


================
@@ -1,370 +1,363 @@
-// 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
+// RUN: rm -rf %t && mkdir -p %t/clang-doc/build %t/clang-doc/include %t/clang-doc/src %t/clang-doc/docs
+// RUN: cp %S/Inputs/index.js %clang_doc_install
+// RUN: cp %S/Inputs/clang-doc-default-stylesheet.css %clang_doc_install
+// 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
----------------
ilovepi wrote:

Why do you need to copy the sources? can't you have the whole "project" under `Inputs` and just use that path? For example, why aren't the headers already in a directory called `include` and the cpp files under `src`?

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


More information about the cfe-commits mailing list