From 35acf8e3b1fe67f5a3ee4ef205bd12968d3d923a Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Sun, 20 Feb 2022 07:29:29 -0800 Subject: [PATCH 1/2] Add known-bug header. --- src/tests/headers.md | 2 ++ src/tests/ui.md | 15 +++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/src/tests/headers.md b/src/tests/headers.md index adc5fa6c9..bdbe0a14e 100644 --- a/src/tests/headers.md +++ b/src/tests/headers.md @@ -87,6 +87,8 @@ found in [`header.rs`] from the compiletest source. * [`revisions`](compiletest.md#revisions) — compile multiple times * [`forbid-output`](compiletest.md#incremental-tests) — incremental cfail rejects output pattern * [`should-ice`](compiletest.md#incremental-tests) — incremental cfail should ICE + * [`known-bug`](ui.md#known-bugs) — indicates that the test is + for a known bug that has not yet been fixed * [Assembly](compiletest.md#assembly-tests) headers * `assembly-output` — the type of assembly output to check diff --git a/src/tests/ui.md b/src/tests/ui.md index a8e8d3b72..00806d0af 100644 --- a/src/tests/ui.md +++ b/src/tests/ui.md @@ -394,6 +394,21 @@ The `ignore-pass` header can be used to ignore the `--pass` CLI flag if the test won't work properly with that override. +## Known bugs + +The `known-bug` header may be used for tests that demonstrate a known bug that +has not yet been fixed. +Adding tests for known bugs is helpful for several reasons: + +1. Maintains a functional test that can be conveniently reused when the bug is fixed. +2. Provides a sentinel that will fail if the bug is incidentally fixed. + This can alert the developer so they know that the associated issue has + been fixed and can possibly be closed. + +Do not include [error annotations](#error-annotations) in a test with `known-bug`. +Otherwise, the test should include the normal headers and stdout/stderr files. + + ## Test organization When deciding where to place a test file, please try to find a subdirectory From e2e74f8478e7ba6073d241c544699b31d46ef717 Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Sun, 20 Feb 2022 12:07:10 -0800 Subject: [PATCH 2/2] Apply suggestions from pierwill Co-authored-by: pierwill <19642016+pierwill@users.noreply.github.com> --- src/tests/ui.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/tests/ui.md b/src/tests/ui.md index 00806d0af..c1c105141 100644 --- a/src/tests/ui.md +++ b/src/tests/ui.md @@ -398,15 +398,15 @@ test won't work properly with that override. The `known-bug` header may be used for tests that demonstrate a known bug that has not yet been fixed. -Adding tests for known bugs is helpful for several reasons: +Adding tests for known bugs is helpful for several reasons, including: -1. Maintains a functional test that can be conveniently reused when the bug is fixed. -2. Provides a sentinel that will fail if the bug is incidentally fixed. +1. Maintaining a functional test that can be conveniently reused when the bug is fixed. +2. Providing a sentinel that will fail if the bug is incidentally fixed. This can alert the developer so they know that the associated issue has been fixed and can possibly be closed. Do not include [error annotations](#error-annotations) in a test with `known-bug`. -Otherwise, the test should include the normal headers and stdout/stderr files. +The test should still include other normal headers and stdout/stderr files. ## Test organization