Skip to content

Commit 02096e2

Browse files
authored
Add known-bug header. (rust-lang#1311)
1 parent e16df87 commit 02096e2

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

Diff for: src/doc/rustc-dev-guide/src/tests/headers.md

+2
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@ found in [`header.rs`] from the compiletest source.
8787
* [`revisions`](compiletest.md#revisions) — compile multiple times
8888
* [`forbid-output`](compiletest.md#incremental-tests) — incremental cfail rejects output pattern
8989
* [`should-ice`](compiletest.md#incremental-tests) — incremental cfail should ICE
90+
* [`known-bug`](ui.md#known-bugs) — indicates that the test is
91+
for a known bug that has not yet been fixed
9092
* [Assembly](compiletest.md#assembly-tests) headers
9193
* `assembly-output` — the type of assembly output to check
9294

Diff for: src/doc/rustc-dev-guide/src/tests/ui.md

+15
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,21 @@ The `ignore-pass` header can be used to ignore the `--pass` CLI flag if the
394394
test won't work properly with that override.
395395

396396

397+
## Known bugs
398+
399+
The `known-bug` header may be used for tests that demonstrate a known bug that
400+
has not yet been fixed.
401+
Adding tests for known bugs is helpful for several reasons, including:
402+
403+
1. Maintaining a functional test that can be conveniently reused when the bug is fixed.
404+
2. Providing a sentinel that will fail if the bug is incidentally fixed.
405+
This can alert the developer so they know that the associated issue has
406+
been fixed and can possibly be closed.
407+
408+
Do not include [error annotations](#error-annotations) in a test with `known-bug`.
409+
The test should still include other normal headers and stdout/stderr files.
410+
411+
397412
## Test organization
398413

399414
When deciding where to place a test file, please try to find a subdirectory

0 commit comments

Comments
 (0)