From 2efcd48bf4554216df740dfd0ed43c8c52f64f08 Mon Sep 17 00:00:00 2001 From: Urgau Date: Thu, 25 Apr 2024 00:03:14 +0200 Subject: [PATCH 1/2] Add documentation for check-cfg by-default in UI tests --- src/tests/headers.md | 1 + src/tests/ui.md | 3 +++ 2 files changed, 4 insertions(+) diff --git a/src/tests/headers.md b/src/tests/headers.md index 1f2474aa0..88a87181e 100644 --- a/src/tests/headers.md +++ b/src/tests/headers.md @@ -91,6 +91,7 @@ found in [`header.rs`] from the compiletest source. * [`error-pattern`](ui.md#error-pattern) — errors not on a line * `incremental` — incremental tests not in the incremental test-suite * `no-prefer-dynamic` — don't use `-C prefer-dynamic`, don't build as a dylib + * `no-auto-check-cfg` — disable auto check-cfg (only for `--check-cfg` tests) * `force-host` — build only for the host target * [`revisions`](compiletest.md#revisions) — compile multiple times * [`forbid-output`](compiletest.md#incremental-tests) — incremental cfail rejects output pattern diff --git a/src/tests/ui.md b/src/tests/ui.md index 3f8502640..08068235a 100644 --- a/src/tests/ui.md +++ b/src/tests/ui.md @@ -361,6 +361,9 @@ multiple `.stderr` files for the different outputs. In the example above, there would be a `.mir.stderr` and `.thir.stderr` file with the different outputs of the different revisions. +> Note: cfg revisions also work inside the source code with `#[cfg]` attributes. +> +> By-convention the `FALSE` cfg is used to have an always false config. ## Controlling pass/fail expectations From 18123e7908a233ed2c209e724c4ecb016d4699d1 Mon Sep 17 00:00:00 2001 From: Urgau <3616612+Urgau@users.noreply.github.com> Date: Thu, 25 Apr 2024 07:46:07 +0200 Subject: [PATCH 2/2] Improve FALSE sentence Co-authored-by: Tshepang Mbambo --- src/tests/ui.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tests/ui.md b/src/tests/ui.md index 08068235a..2eda0b51e 100644 --- a/src/tests/ui.md +++ b/src/tests/ui.md @@ -363,7 +363,7 @@ with the different outputs of the different revisions. > Note: cfg revisions also work inside the source code with `#[cfg]` attributes. > -> By-convention the `FALSE` cfg is used to have an always false config. +> By convention, the `FALSE` cfg is used to have an always-false config. ## Controlling pass/fail expectations