You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: libcxx/docs/TestingLibcxx.rst
+10-2Lines changed: 10 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -351,15 +351,23 @@ Test Filenames`_ when determining the names for new test files.
351
351
- Same as ``FOO.pass.cpp``, but for Objective-C++.
352
352
353
353
* - ``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.
355
356
* - ``FOO.compile.pass.mm``
356
357
- Same as ``FOO.compile.pass.cpp``, but for Objective-C++.
357
358
* - ``FOO.compile.fail.cpp``
358
359
- Checks that the code in the file does *not* compile successfully.
359
360
360
361
* - ``FOO.verify.cpp``
361
362
- 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.
363
371
364
372
* - ``FOO.link.pass.cpp``
365
373
- Checks that the C++ code in the file compiles and links successfully -- no run attempted.
0 commit comments