Skip to content

Commit a5f8fbd

Browse files
committed
fixup! [libcxx][docs] Make test name pattern documentation more obvious
Add recommendation on when to write verify tests.
1 parent be73e31 commit a5f8fbd

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

libcxx/docs/TestingLibcxx.rst

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -351,15 +351,23 @@ Test Filenames`_ when determining the names for new test files.
351351
- Same as ``FOO.pass.cpp``, but for Objective-C++.
352352

353353
* - ``FOO.compile.pass.cpp``
354-
- Checks whether the C++ code in the file compiles successfully.
354+
- Checks whether the C++ code in the file compiles successfully. In general, prefer `compile` tests over `verify` tests,
355+
subject to the specific recommendations, below, for when to write `verify` tests.
355356
* - ``FOO.compile.pass.mm``
356357
- Same as ``FOO.compile.pass.cpp``, but for Objective-C++.
357358
* - ``FOO.compile.fail.cpp``
358359
- Checks that the code in the file does *not* compile successfully.
359360

360361
* - ``FOO.verify.cpp``
361362
- Compiles with clang-verify. This type of test is automatically marked as UNSUPPORTED if the compiler does not support clang-verify.
362-
For additional information about how to write tests using ``clang-verify``, see the `Internals Manual <https://clang.llvm.org/docs/InternalsManual.html#verifying-diagnostics>`_.
363+
For additional information about how to write `verify` tests, see the `Internals Manual <https://clang.llvm.org/docs/InternalsManual.html#verifying-diagnostics>`_.
364+
Prefer `verify` tests over `compile` tests to test that compilation fails for a particular reason. For example, use a `verify` test
365+
to ensure that
366+
367+
* an expected ``static_assert`` is triggered;
368+
* the use of deprecated functions generates the proper warning;
369+
* removed functions are no longer usable; or
370+
* return values from functions marked ``[[nodiscard]]`` are stored.
363371

364372
* - ``FOO.link.pass.cpp``
365373
- Checks that the C++ code in the file compiles and links successfully -- no run attempted.

0 commit comments

Comments
 (0)