From 23775ebb623101bdb9b19a2e753701433a50f9b0 Mon Sep 17 00:00:00 2001 From: Zalathar Date: Tue, 11 Jun 2024 21:05:38 +1000 Subject: [PATCH 1/3] Docs for `needs-forced-clang-based-tests` (was `needs-matching-clang`) --- src/tests/headers.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/tests/headers.md b/src/tests/headers.md index f41144774..eb55b4255 100644 --- a/src/tests/headers.md +++ b/src/tests/headers.md @@ -173,11 +173,12 @@ The following header commands will check LLVM support: * `ignore-llvm-version: 7.0 - 9.9.9` — ignores LLVM versions in a range (inclusive) * `needs-llvm-components: powerpc` — ignores if the specific LLVM component was not built. Note: The test will fail on CI (when `COMPILETEST_REQUIRE_ALL_LLVM_COMPONENTS` is set) if the component does not exist. -* `needs-matching-clang` — ignores if the version of clang does not match the - LLVM version of rustc. - These tests are always ignored unless a special environment variable, - `RUSTBUILD_FORCE_CLANG_BASED_TESTS`, is set - (which is only done in one CI job [`x86_64-gnu-debug`]). +* `needs-forced-clang-based-tests` — + test is ignored unless the environment variable `RUSTBUILD_FORCE_CLANG_BASED_TESTS` + is set, which enables building clang alongside LLVM + - This is only set in one CI job ([`x86_64-gnu-debug`]), which only runs a tiny + subset of `run-make` tests. Other tests with this header will not run at all, + which is usually not what you want. See also [Debuginfo tests](compiletest.md#debuginfo-tests) for headers for ignoring debuggers. From ffb1a3631cddd33bed85377ae529d9595a54ce5f Mon Sep 17 00:00:00 2001 From: Zalathar Date: Tue, 11 Jun 2024 21:10:55 +1000 Subject: [PATCH 2/3] Docs for `aux-codegen-backend` --- src/tests/compiletest.md | 7 ++++++- src/tests/headers.md | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/tests/compiletest.md b/src/tests/compiletest.md index bdad9b96b..89b05a91c 100644 --- a/src/tests/compiletest.md +++ b/src/tests/compiletest.md @@ -516,11 +516,12 @@ only running the main `coverage` suite. ## Building auxiliary crates It is common that some tests require additional auxiliary crates to be compiled. -There are three [headers](headers.md) to assist with that: +There are multiple [headers](headers.md) to assist with that: * `aux-build` * `aux-crate` * `aux-bin` +* `aux-codegen-backend` `aux-build` will build a separate crate from the named source file. The source file should be in a directory called `auxiliary` beside the test file. @@ -549,6 +550,10 @@ This is similar to how Cargo does dependency renaming. library. The binary will be available in `auxiliary/bin` relative to the working directory of the test. +`aux-codegen-backend` is similar to `aux-build`, but will then pass the compiled +dylib to `-Zcodegen-backend` when building the main file. This will only work +for tests in `tests/ui-fulldeps`, since it requires the use of compiler crates. + ### Auxiliary proc-macro If you want a proc-macro dependency, then there currently is some ceremony diff --git a/src/tests/headers.md b/src/tests/headers.md index eb55b4255..aa1fb17e9 100644 --- a/src/tests/headers.md +++ b/src/tests/headers.md @@ -63,6 +63,8 @@ found in [`header.rs`] from the compiletest source. * [Building auxiliary crates](compiletest.md#building-auxiliary-crates) * `aux-build` * `aux-crate` + * `aux-bin` + * `aux-codegen-backend` * [Pretty-printer](compiletest.md#pretty-printer-tests) headers * `pretty-compare-only` * `pretty-expanded` From fd68d95cf95c2727519bbefd7b7eef53b21aee09 Mon Sep 17 00:00:00 2001 From: Zalathar Date: Wed, 12 Jun 2024 23:28:40 +1000 Subject: [PATCH 3/3] Docs for `{{sysroot-base}}` and `{{target-linker}}` --- src/tests/headers.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/tests/headers.md b/src/tests/headers.md index aa1fb17e9..ef039e44d 100644 --- a/src/tests/headers.md +++ b/src/tests/headers.md @@ -283,6 +283,11 @@ described below: - `{{build-base}}`: The base directory where the test's output goes. This is equivalent to `$TEST_BUILD_DIR` for [output normalization]. - Example: `/path/to/rust/build/x86_64-unknown-linux-gnu/test/ui` +- `{{sysroot-base}}`: Path of the sysroot directory used to build the test. + - Mainly intended for `ui-fulldeps` tests that run the compiler via API. +- `{{target-linker}}`: Linker that would be passed to `-Clinker` for this test, + or blank if no linker override is active. + - Mainly intended for `ui-fulldeps` tests that run the compiler via API. - `{{target}}`: The target the test is compiling for - Example: `x86_64-unknown-linux-gnu`