f62f490fd4
Migrate compiletest to use `ui_test`-style `//@` directives ## Preface There's an on-going effort to rewrite parts of or the entirety of compiletest (<https://github.com/rust-lang/compiler-team/issues/536>). A step towards this involve migrating compiletest tests to use the [`ui_test`](https://github.com/oli-obk/ui_test) framework, which involves changing compiletest directives in `// <directive-name>` style to `ui_test` `//@ <directive-name>` style (https://github.com/rust-lang/compiler-team/issues/512). This PR aims to implement the directive-style change from `//` to `//`@`` for the remaining non-"ui" test suite tests. ## Key Changes 1. All `tests/` tests now use `//`@`` directives. 2. Compiletest only accepts `//`@`` and issues an error if an old-style directive is detected. 3. `// ignore-tidy` and `// ignore-tidy-*` are considered tidy directives and are ignored by compiletest header parsing. ## Diff Generation The diff is generated by: - Collecting directives from `tests/` via hijacking compiletest to emit successfully parsed directive lines. - Using a migration tool (<https://github.com/jieyouxu/compiletest-ui_test-header-migration/tree/master>) to replace `//` directives in compiletest tests with `//`@`.` ### Reproduction Steps 0. Delete the temporary file `$RUSTC_REPO_PATH/build/<target_triple>/test/__directive_lines.txt`, if the collection script was previously ran. 1. Use the <https://github.com/jieyouxu/rust/tree/collect-test-directives> collect-test-directives script, which outputs a temporary file recording headers occuring in each compiletest test. - You need to checkout this branch: `git checkout collect-test-directives`. - This needs to be rebased on latest master to ensure up-to-date test directives can be collected. - You need to run `./x test` on each of the `test/*` subfolders once: ```bash ./x test tests/assembly/ --stage 1 --force-rerun ./x test tests/codegen/ --stage 1 --force-rerun ./x test tests/codegen-units/ --stage 1 --force-rerun ./x test tests/coverage/ --stage 1 --force-rerun ./x test tests/coverage-run-rustdoc/ --stage 1 --force-rerun ./x test tests/debuginfo/ --stage 1 --force-rerun ./x test tests/incremental/ --stage 1 --force-rerun ./x test tests/mir-opt/ --stage 1 --force-rerun ./x test tests/pretty/ --stage 1 --force-rerun ./x test tests/run-make/ --stage 1 --force-rerun ./x test tests/run-make-fulldeps/ --stage 1 --force-rerun ./x test tests/run-pass-valgrind/ --stage 1 --force-rerun ./x test tests/rustdoc/ --stage 1 --force-rerun TARGET=<target-triple> ./x test tests/rustdoc-gui/ --stage 1 --force-rerun ./x test tests/rustdoc-js/ --stage 1 --force-rerun ./x test tests/rustdoc-js-std/ --stage 1 --force-rerun ./x test tests/rustdoc-json/ --stage 1 --force-rerun ./x test tests/rustdoc-ui/ --stage 1 --force-rerun ./x test tests/ui/ --stage 1 --force-rerun ./x test tests/ui-fulldeps/ --stage 1 --force-rerun ``` 2. Checkout the `migrate-compiletest-directives` branch. 3. Run the migration tool <https://github.com/jieyouxu/compiletest-ui_test-header-migration>. 4. Check that the migration at least does not cause test failures if you change compiletest to accept `//`@`` directives only. This is also required if the test outputs somehow need to be blessed. - `RUSTC_TEST_FAIL_FAST=1 ./x test tests/<secondary-directory> --stage 1 --bless` 5. Confirm that there is no difference after running the migration tool when you are on the `migrate-compiletest-directives` branch. ## Follow Up Work - [ ] Adjust rustc-dev-guide docs for compiletest directives (this time for all the other suites and modes). <https://github.com/rust-lang/rustc-dev-guide/pull/1895>. |
||
---|---|---|
.github | ||
.reuse | ||
compiler | ||
library | ||
LICENSES | ||
src | ||
tests | ||
.editorconfig | ||
.git-blame-ignore-revs | ||
.gitattributes | ||
.gitignore | ||
.gitmodules | ||
.mailmap | ||
Cargo.lock | ||
Cargo.toml | ||
CODE_OF_CONDUCT.md | ||
config.example.toml | ||
configure | ||
CONTRIBUTING.md | ||
COPYRIGHT | ||
INSTALL.md | ||
LICENSE-APACHE | ||
LICENSE-MIT | ||
README.md | ||
RELEASES.md | ||
rust-bors.toml | ||
rustfmt.toml | ||
triagebot.toml | ||
x | ||
x.ps1 | ||
x.py |
The Rust Programming Language
This is the main source code repository for Rust. It contains the compiler, standard library, and documentation.
Note: this README is for users rather than contributors. If you wish to contribute to the compiler, you should read CONTRIBUTING.md instead.
Table of Contents
Quick Start
Read "Installation" from The Book.
Installing from Source
If you really want to install from source (though this is not recommended), see INSTALL.md.
Getting Help
See https://www.rust-lang.org/community for a list of chat platforms and forums.
Contributing
See CONTRIBUTING.md.
License
Rust is primarily distributed under the terms of both the MIT license and the Apache License (Version 2.0), with portions covered by various BSD-like licenses.
See LICENSE-APACHE, LICENSE-MIT, and COPYRIGHT for details.
Trademark
The Rust Foundation owns and protects the Rust and Cargo trademarks and logos (the "Rust Trademarks").
If you want to use these names or brands, please read the media guide.
Third-party logos may be subject to third-party copyrights and trademarks. See Licenses for details.