Auto merge of #138058 - jieyouxu:rollup-skdt0oz, r=jieyouxu
Rollup of 20 pull requests Successful merges: - #134063 (dec2flt: Clean up float parsing modules) - #136581 (Retire the legacy `Makefile`-based `run-make` test infra) - #136662 (Count char width at most once in `Formatter::pad`) - #136764 (Make `ptr_cast_add_auto_to_object` lint into hard error) - #136798 (Added documentation for flushing per #74348) - #136865 (Perform deeper compiletest path normalization for `$TEST_BUILD_DIR` to account for compare-mode/debugger cases, and normalize long type file filename hashes) - #136975 (Look for `python3` first on MacOS, not `py`) - #136977 (Upload Datadog metrics with citool) - #137240 (Slightly reformat `std::fs::remove_dir_all` error docs) - #137298 (Check signature WF when lowering MIR body) - #137463 ([illumos] attempt to use posix_spawn to spawn processes) - #137477 (uefi: Add Service Binding Protocol abstraction) - #137569 (Stabilize `string_extend_from_within`) - #137633 (Only use implied bounds hack if bevy, and use deeply normalize in implied bounds hack) - #137679 (Various coretests improvements) - #137723 (Make `rust.description` more general-purpose and pass `CFG_VER_DESCRIPTION`) - #137728 (Remove unsizing coercions for tuples) - #137731 (Resume one waiter at once in deadlock handler) - #137875 (mir_build: Integrate "simplification" steps into match-pair-tree creation) - #138028 (compiler: add `ExternAbi::is_rustic_abi`) r? `@ghost` `@rustbot` modify labels: rollup
This commit is contained in:
commit
7efb58d26f
|
|
@ -74,8 +74,7 @@ The following test suites are available, with links for more information:
|
|||
|
||||
### General purpose test suite
|
||||
|
||||
[`run-make`](#run-make-tests) are general purpose tests using Rust programs (or
|
||||
Makefiles (legacy)).
|
||||
[`run-make`](#run-make-tests) are general purpose tests using Rust programs.
|
||||
|
||||
### Rustdoc test suites
|
||||
|
||||
|
|
@ -396,14 +395,6 @@ your test, causing separate files to be generated for 32bit and 64bit systems.
|
|||
|
||||
### `run-make` tests
|
||||
|
||||
> **Note on phasing out `Makefile`s**
|
||||
>
|
||||
> We are planning to migrate all existing Makefile-based `run-make` tests
|
||||
> to Rust programs. You should not be adding new Makefile-based `run-make`
|
||||
> tests.
|
||||
>
|
||||
> See <https://github.com/rust-lang/rust/issues/121876>.
|
||||
|
||||
The tests in [`tests/run-make`] are general-purpose tests using Rust *recipes*,
|
||||
which are small programs (`rmake.rs`) allowing arbitrary Rust code such as
|
||||
`rustc` invocations, and is supported by a [`run_make_support`] library. Using
|
||||
|
|
@ -424,11 +415,6 @@ Compiletest directives like `//@ only-<target>` or `//@ ignore-<target>` are
|
|||
supported in `rmake.rs`, like in UI tests. However, revisions or building
|
||||
auxiliary via directives are not currently supported.
|
||||
|
||||
Two `run-make` tests are ported over to Rust recipes as examples:
|
||||
|
||||
- <https://github.com/rust-lang/rust/tree/master/tests/run-make/CURRENT_RUSTC_VERSION>
|
||||
- <https://github.com/rust-lang/rust/tree/master/tests/run-make/a-b-a-linker-guard>
|
||||
|
||||
#### Quickly check if `rmake.rs` tests can be compiled
|
||||
|
||||
You can quickly check if `rmake.rs` tests can be compiled without having to
|
||||
|
|
@ -481,20 +467,6 @@ Then add a corresponding entry to `"rust-analyzer.linkedProjects"`
|
|||
],
|
||||
```
|
||||
|
||||
#### Using Makefiles (legacy)
|
||||
|
||||
<div class="warning">
|
||||
You should avoid writing new Makefile-based `run-make` tests.
|
||||
</div>
|
||||
|
||||
Each test should be in a separate directory with a `Makefile` indicating the
|
||||
commands to run.
|
||||
|
||||
There is a [`tools.mk`] Makefile which you can include which provides a bunch of
|
||||
utilities to make it easier to run commands and compare outputs. Take a look at
|
||||
some of the other tests for some examples on how to get started.
|
||||
|
||||
[`tools.mk`]: https://github.com/rust-lang/rust/blob/master/tests/run-make/tools.mk
|
||||
[`tests/run-make`]: https://github.com/rust-lang/rust/tree/master/tests/run-make
|
||||
[`run_make_support`]: https://github.com/rust-lang/rust/tree/master/src/tools/run-make-support
|
||||
|
||||
|
|
|
|||
|
|
@ -6,10 +6,7 @@
|
|||
FIXME(jieyouxu) completely revise this chapter.
|
||||
-->
|
||||
|
||||
Directives are special comments that tell compiletest how to build and interpret
|
||||
a test. They must appear before the Rust source in the test. They may also
|
||||
appear in `rmake.rs` or legacy Makefiles for [run-make
|
||||
tests](compiletest.md#run-make-tests).
|
||||
Directives are special comments that tell compiletest how to build and interpret a test. They must appear before the Rust source in the test. They may also appear in `rmake.rs` [run-make tests](compiletest.md#run-make-tests).
|
||||
|
||||
They are normally put after the short comment that explains the point of this
|
||||
test. Compiletest test suites use `//@` to signal that a comment is a directive.
|
||||
|
|
@ -222,8 +219,6 @@ The following directives will check LLVM support:
|
|||
[`aarch64-gnu-debug`]), which only runs a
|
||||
subset of `run-make` tests. Other tests with this directive will not
|
||||
run at all, which is usually not what you want.
|
||||
- Notably, the [`aarch64-gnu-debug`] CI job *currently* only runs `run-make`
|
||||
tests which additionally contain `clang` in their test name.
|
||||
|
||||
See also [Debuginfo tests](compiletest.md#debuginfo-tests) for directives for
|
||||
ignoring debuggers.
|
||||
|
|
|
|||
|
|
@ -238,30 +238,6 @@ This is much faster, but doesn't always work. For example, some tests include
|
|||
directives that specify specific compiler flags, or which rely on other crates,
|
||||
and they may not run the same without those options.
|
||||
|
||||
## Running `run-make` tests
|
||||
|
||||
### Windows
|
||||
|
||||
Running the `run-make` test suite on Windows is a currently bit more involved.
|
||||
There are numerous prerequisites and environmental requirements:
|
||||
|
||||
- Install msys2: <https://www.msys2.org/>
|
||||
- Specify `MSYS2_PATH_TYPE=inherit` in `msys2.ini` in the msys2 installation directory, run the
|
||||
following with `MSYS2 MSYS`:
|
||||
- `pacman -Syuu`
|
||||
- `pacman -S make`
|
||||
- `pacman -S diffutils`
|
||||
- `pacman -S binutils`
|
||||
- `./x test run-make` (`./x test tests/run-make` doesn't work)
|
||||
|
||||
There is [on-going work][port-run-make] to not rely on `Makefile`s in the
|
||||
run-make test suite. Once this work is completed, you can run the entire
|
||||
`run-make` test suite on native Windows inside `cmd` or `PowerShell` without
|
||||
needing to install and use MSYS2. As of <!--date-check --> Oct 2024, it is
|
||||
already possible to run the vast majority of the `run-make` test suite outside
|
||||
of MSYS2, but there will be failures for the tests that still use `Makefile`s
|
||||
due to not finding `make`.
|
||||
|
||||
## Running tests on a remote machine
|
||||
|
||||
Tests may be run on a remote machine (e.g. to test builds for a different
|
||||
|
|
@ -406,4 +382,3 @@ If you encounter bugs or problems, don't hesitate to open issues on the
|
|||
repository](https://github.com/rust-lang/rustc_codegen_gcc/).
|
||||
|
||||
[`tests/ui`]: https://github.com/rust-lang/rust/tree/master/tests/ui
|
||||
[port-run-make]: https://github.com/rust-lang/rust/issues/121876
|
||||
|
|
|
|||
Loading…
Reference in New Issue