This is an archive of the discontinued LLVM Phabricator instance.

[docs][FileCheck] add link to VerifyDiagnosticConsumer docs
Needs ReviewPublic

Authored by nickdesaulniers on Mar 6 2020, 9:42 AM.

Details

Summary

I find the VerifyDiagnosticConsumer docs hard to find otherwise, and I
think most folks writing tests for Clang end up on the FileCheck page,
regardless of whether the test they're trying to write uses FileCheck or
just -verify.

Diff Detail

Event Timeline

nickdesaulniers created this revision.Mar 6 2020, 9:42 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 6 2020, 9:42 AM

It seems a bit weird to me for the FileCheck docs to be talking about -verify at all. FileCheck is a standalone program in LLVM (so the reader may not be considering Clang at all), and -verify is a clang command line option. I did a bit of googling and it doesn't look like we have a particularly good testing page for Clang like we do for LLVM (https://llvm.org/docs/TestingGuide.html) -- the closest we have is https://clang.llvm.org/hacking.html#testing. I sort of wonder if this is a sign that we should add one?

Hmm, so I've created a new document, clang/docs/Testing.rst but:

$ cd llvm/build
$ cmake <usual stuff> -DLLVM_ENABLE_SPHINX=true -DSPHINX_OUTPUT_HTML=true
$ ninja docs-clang-html
[1/2] Generating html Sphinx documentation for .../llvm-project/llvm/build/tools/clang/docs/html"
FAILED: tools/clang/docs/CMakeFiles/docs-clang-html 
cd /android0/llvm-project/llvm/build/tools/clang/docs && /usr/bin/sphinx-build -b html -d /android0/llvm-project/llvm/build/tools/clang/docs/_doctrees-clang-html -q -W /android0/llvm-project/clang/docs /android0/llvm-project/llvm/build/tools/clang/docs/html

Warning, treated as error:
/android0/llvm-project/clang/docs/ClangCommandLineReference.rst:22:Duplicate explicit target name: "cmdoption-clang--prefix".
ninja: build stopped: subcommand failed.

Hmm, so I've created a new document, clang/docs/Testing.rst but:

$ cd llvm/build
$ cmake <usual stuff> -DLLVM_ENABLE_SPHINX=true -DSPHINX_OUTPUT_HTML=true
$ ninja docs-clang-html
[1/2] Generating html Sphinx documentation for .../llvm-project/llvm/build/tools/clang/docs/html"
FAILED: tools/clang/docs/CMakeFiles/docs-clang-html 
cd /android0/llvm-project/llvm/build/tools/clang/docs && /usr/bin/sphinx-build -b html -d /android0/llvm-project/llvm/build/tools/clang/docs/_doctrees-clang-html -q -W /android0/llvm-project/clang/docs /android0/llvm-project/llvm/build/tools/clang/docs/html

Warning, treated as error:
/android0/llvm-project/clang/docs/ClangCommandLineReference.rst:22:Duplicate explicit target name: "cmdoption-clang--prefix".
ninja: build stopped: subcommand failed.

Yeah, we continually run into this "duplicate explicit target name" in the command line reference. You should pass -DSPHINX_WARNINGS_AS_ERRORS=OFF when configuring cmake, unfortunately.