Skip to content

Commit 3f0b69b

Browse files
authored
Compiletest docs for recently-added features (#1994)
* Docs for `needs-forced-clang-based-tests` (was `needs-matching-clang`) * Docs for `aux-codegen-backend` * Docs for `{{sysroot-base}}` and `{{target-linker}}`
1 parent 9179f48 commit 3f0b69b

File tree

2 files changed

+19
-6
lines changed

2 files changed

+19
-6
lines changed

src/tests/compiletest.md

+6-1
Original file line numberDiff line numberDiff line change
@@ -516,11 +516,12 @@ only running the main `coverage` suite.
516516
## Building auxiliary crates
517517

518518
It is common that some tests require additional auxiliary crates to be compiled.
519-
There are three [headers](headers.md) to assist with that:
519+
There are multiple [headers](headers.md) to assist with that:
520520

521521
* `aux-build`
522522
* `aux-crate`
523523
* `aux-bin`
524+
* `aux-codegen-backend`
524525

525526
`aux-build` will build a separate crate from the named source file.
526527
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.
549550
library. The binary will be available in `auxiliary/bin` relative to the working
550551
directory of the test.
551552

553+
`aux-codegen-backend` is similar to `aux-build`, but will then pass the compiled
554+
dylib to `-Zcodegen-backend` when building the main file. This will only work
555+
for tests in `tests/ui-fulldeps`, since it requires the use of compiler crates.
556+
552557
### Auxiliary proc-macro
553558

554559
If you want a proc-macro dependency, then there currently is some ceremony

src/tests/headers.md

+13-5
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ found in [`header.rs`] from the compiletest source.
6363
* [Building auxiliary crates](compiletest.md#building-auxiliary-crates)
6464
* `aux-build`
6565
* `aux-crate`
66+
* `aux-bin`
67+
* `aux-codegen-backend`
6668
* [Pretty-printer](compiletest.md#pretty-printer-tests) headers
6769
* `pretty-compare-only`
6870
* `pretty-expanded`
@@ -173,11 +175,12 @@ The following header commands will check LLVM support:
173175
* `ignore-llvm-version: 7.0 - 9.9.9` — ignores LLVM versions in a range (inclusive)
174176
* `needs-llvm-components: powerpc` — ignores if the specific LLVM component was not built.
175177
Note: The test will fail on CI (when `COMPILETEST_REQUIRE_ALL_LLVM_COMPONENTS` is set) if the component does not exist.
176-
* `needs-matching-clang` — ignores if the version of clang does not match the
177-
LLVM version of rustc.
178-
These tests are always ignored unless a special environment variable,
179-
`RUSTBUILD_FORCE_CLANG_BASED_TESTS`, is set
180-
(which is only done in one CI job [`x86_64-gnu-debug`]).
178+
* `needs-forced-clang-based-tests`
179+
test is ignored unless the environment variable `RUSTBUILD_FORCE_CLANG_BASED_TESTS`
180+
is set, which enables building clang alongside LLVM
181+
- This is only set in one CI job ([`x86_64-gnu-debug`]), which only runs a tiny
182+
subset of `run-make` tests. Other tests with this header will not run at all,
183+
which is usually not what you want.
181184

182185
See also [Debuginfo tests](compiletest.md#debuginfo-tests) for headers for
183186
ignoring debuggers.
@@ -280,6 +283,11 @@ described below:
280283
- `{{build-base}}`: The base directory where the test's output goes. This is
281284
equivalent to `$TEST_BUILD_DIR` for [output normalization].
282285
- Example: `/path/to/rust/build/x86_64-unknown-linux-gnu/test/ui`
286+
- `{{sysroot-base}}`: Path of the sysroot directory used to build the test.
287+
- Mainly intended for `ui-fulldeps` tests that run the compiler via API.
288+
- `{{target-linker}}`: Linker that would be passed to `-Clinker` for this test,
289+
or blank if no linker override is active.
290+
- Mainly intended for `ui-fulldeps` tests that run the compiler via API.
283291
- `{{target}}`: The target the test is compiling for
284292
- Example: `x86_64-unknown-linux-gnu`
285293

0 commit comments

Comments
 (0)