This is an archive of the discontinued LLVM Phabricator instance.

Extend documentation of how to test clang-tidy checks.

Authored by jdennett on Dec 30 2016, 6:27 PM.



The documentation assumed expertise with FileCheck; many clang-tidy check
authors may not have significant exposure to FileCheck, and so it's worth
spending a few more words here to spell things out.

Event Timeline

jdennett updated this revision to Diff 82752.Dec 30 2016, 6:27 PM
jdennett retitled this revision from to Extend documentation of how to test clang-tidy checks..
jdennett updated this object.
jdennett added a reviewer: alexfh.
alexfh accepted this revision.Dec 31 2016, 1:33 AM
alexfh edited edge metadata.

Awesome! Thank you for adding clarity to this part.

Looks good with a couple of nits.


Inline code snippets in rst should use double backquotes. I know, that's confusing, but it's what we have to deal with.


Put an underscore after FileCheck (as in line 549). This is a syntax for a named reference. See also

This revision is now accepted and ready to land.Dec 31 2016, 1:33 AM
alexfh added inline comments.Dec 31 2016, 1:44 AM

I'm not sure the term "matcher tests" is used anywhere else in our documentation. And it doesn't seem obvious to me either (if it refers to AST matchers, then it's just an implementation detail of clang-tidy checks, if it refers to the check patterns, then it's not a commonly used term for those either). I don't know what would be a good short replacement, maybe "clang-tidy lit tests" or just "clang-tidy tests".

jdennett marked 2 inline comments as done.Jan 2 2017, 1:48 PM

Thanks for the review. I've address your comments, and will check over the (presumed-final) diff before submitting.


I went with clang-tidy tests. (The "matcher test" references are because I was thinking about some new matchers such as argumentsAre(arg1, ..., argn) at the same time, and didn't manage to do a complete context switch when working on these docs. Thanks for catching that.)

jdennett updated this revision to Diff 82818.Jan 2 2017, 1:50 PM
jdennett edited edge metadata.

Addressed review comments: double-backtick quoting, underscores for references
to FileCheck, and change "matcher tests" to "clang-tidy tests".

jdennett closed this revision.Jan 2 2017, 1:56 PM
alexfh added inline comments.Jan 2 2017, 3:05 PM

Looks like you missed this line when changing to double backquotes.