[cfe-dev] Test Design
dgregor at apple.com
Fri Jul 15 14:09:01 PDT 2011
On Jul 15, 2011, at 1:02 PM, John Freeman wrote:
> How are tests designed in Clang? More specifically:
> - How should a test file be named?
> For tests in CXX/, it seems to be named after a paragraph in the
> standard, with "-0x" for C++0x feature testing, and placed in a
> directory named after the section in the standard. If so, what document
> are we using for the C++0x standard? I thought it might be N3242, but
> there is a test named clang/test/CXX/expr/expr.prim/p12-0x.cpp, and I
> don't see a paragraph 12 in section 5.1 [expr.prim].
Use the FDIS as your guide. Many tests predate the FDIS, and paragraphs have moved around, so the test paragraph numbers are out of date.
> - What should go in the test?
> For C++, I'm guessing we test parsing diagnostics in CXX/ and sema
> diagnostics in SemaCXX/?
Parsing tests can also go into test/Parse.
test/CXX is meant for general testing. Some parsing, mostly semantic analysis.
> Most tests in CXX/ are run with "-fsyntax-only -verify", but some
> aren't. How do I determine the best way to run the test?
If it doesn't require code generation, use -fsyntax-only -verify.
More information about the cfe-dev