Test Design

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].

- What should go in the test?

For C++, I'm guessing we test parsing diagnostics in CXX/ and sema diagnostics in SemaCXX/?
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?

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.

  - Doug