[clang-tools-extra] [clang-doc] Add --asset option to clang-doc (PR #94717)

Paul Kirth via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 7 17:16:26 PDT 2024


================
@@ -0,0 +1,14 @@
+// RUN: rm -rf %t
+// RUN: mkdir %t
+// RUN: echo "" > %t/compile_flags.txt
+// RUN: cp "%s" "%t/test.cpp"
+// RUN: clang-doc --format=html --executor=standalone -p %t %t/test.cpp -output=%t/docs > %t/output.txt
+// RUN: cat %t/output.txt | FileCheck %s --check-prefix=CHECK
----------------
ilovepi wrote:

```suggestion
// RUN: clang-doc --format=html --executor=standalone -p %t %s -output=%t/docs 2>&1 | FileCheck %s 
```
1. No point in making an empty file. If it was necessary, `touch` would have been more appropriate. (BTW, what is compile_flags.txt?)
1.  you can just reference this test file, just as well, without copying it at all. If there's some reason it has to be that way, write it down in comments.
1. no need for `output.txt`, just pipe it straight into `FileCheck`. If you need the file later, you still don't need to `cat`, you can just pass the file to `FileCheck`
2. You don't need to list `CHECK` under `--check-prefix=`. It's the default.

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


More information about the cfe-commits mailing list