about summary refs log tree commit diff
path: root/src/bootstrap/test.rs
AgeCommit message (Collapse)AuthorLines
2023-07-30bootstrap: inline format!() argsMatthias Krüger-4/+4
2023-07-26Unite bless environment variables under `RUSTC_BLESS`Trevor Gross-18/+7
Currently, Clippy, Miri, Rustfmt, and rustc all use an environment variable to indicate that output should be blessed, but they use different variable names. In order to improve consistency, this patch applies the following changes: - Emit `RUSTC_BLESS` within `prepare_cargo_test` so it is always available - Change usage of `MIRI_BLESS` in the Miri subtree to use `RUSTC_BLESS` - Change usage of `BLESS` in the Clippy subtree to `RUSTC_BLESS` - Change usage of `BLESS` in the Rustfmt subtree to `RUSTC_BLESS` - Adjust the blessable test in `rustc_errors` to use this same convention - Update documentation where applicable Any tools that uses `RUSTC_BLESS` should check that it is set to any value other than `"0"`.
2023-07-26Make `x test src/tools/rustfmt --bless` format rustfmt with the freshly ↵Oli Scherer-0/+4
built in-tree version
2023-07-20Avoid another gha group nestingOli Scherer-1/+2
2023-07-15Rollup merge of #113643 - jyn514:try-run, r=ozkanonurjyn-42/+17
bootstrap: Clean up try_run r? `@ozkanonur` since you reviewed `@GuillaumeGomez's` PR i recommend reviewing commit-by-commit
2023-07-15Rollup merge of #113644 - jyn514:bootstrap-cleanups, r=albertlarsan68Matthias Krüger-4/+4
misc bootstrap cleanups - rename `detail_exit_macro` to `exit` - remove unnecessary `Builder::new_standalone` function - support `x suggest` with build-metrics
2023-07-15Replace `builder::try_run_quiet` with `run_quiet_delaying_failure`jyn-14/+1
It was only used when a `builder` is available, and I want to encourage using the version that supports `--no-fail-fast`.
2023-07-15Rename `Builder::try_run` to `run_delaying_failure`jyn-14/+14
2023-07-15Deduplicate `Builder::try_run` and mark `Config::try_run` as deprecatedjyn-28/+16
This does three things: 1. Remove `forward!(Build, fn try_run())`. Having `try_run` behave differently as a free function than an associated function is confusing, and `Builder::try_run` is a very desirable name. 2. Move `test::try_run` and `run::try_run` to `Builder::try_run`. These functions are different than `Config::try_run` - they delay the failure and print it out at the end of the build. 3. Mark `Config::try_run` as deprecated to encourage people to use `Builder::try_run` instead.
2023-07-14add a couple more groupsjyn-7/+12
- group rustdoc-js-std - group rust-installer/test.sh
2023-07-14Add must_use to `msg_` functionsjyn-41/+57
This caught several places which weren't waiting until the command finished to drop the Group. I also took the liberty of calling `msg_sysroot_tool` from `run_cargo_test` to reduce code duplication and make errors like this less likely in the future.
2023-07-14Add GHA log groups for tool testsjyn-0/+20
2023-07-14fix nested GHA groups (redux)jyn-10/+6
2023-07-14Add even more GHA log groupsjyn-15/+36
This also adds a dynamic check that we don't emit nested groups, since GHA currently doesn't support them.
2023-07-14bootstrap: update defaults for `compiler` and `library` aliasesLukas Markeffsky-0/+1
2023-07-13Rename `detail_exit_macro` to `exit`jyn-4/+4
`detail` and `macro` weren't adding any info.
2023-07-13Make `nodejs` control the default for RustdocJs tests instead of a hard-off ↵jyn-43/+39
switch If someone says `x test rustdoc-js-std` explicitly on the command line, it's because they want to run the tests. Give an error instead of doing nothing and reporting success.
2023-07-12Auto merge of #113214 - GuillaumeGomez:try-run-fix, r=ozkanonur,jyn514bors-20/+16
Don't fail early if `try_run` returns an error Fixes https://github.com/rust-lang/rust/issues/113208. Follow-up of #112962. r? `@jyn514`
2023-07-11Rollup merge of #113373 - jyn514:download-rustc-fixes, r=albertlarsan68Jubilee-1/+1
various download-rustc fixes separated out from https://github.com/rust-lang/rust/pull/112143 because it keeps getting stuck in limbo. best reviewed commit-by-commit
2023-07-11Don't fail early if `try_run` returns an errorGuillaume Gomez-20/+16
2023-07-09Port PGO/LTO/BOLT optimized build pipeline to RustJakub Beránek-4/+4
2023-07-08Fail the build if clippy tests don't passNilstrieb-0/+4
This was removed in https://github.com/rust-lang/rust/pull/113260/commits/de69d556eb5006a21f868b8c12d48f0ef1308a5a#diff-8479eab02701e686aedb15b567dc8fc31220c6e4efb9565ccc9d662b7fee2214 which caused CI to ignore clippy failures. This adds back the exit, which should cause CI to fail again if a test is broken (like right now, as clippy tests are broken on master).
2023-07-05fix `x test --stage 0 core`jyn-1/+1
2023-07-05Auto merge of #112697 - tgross35:explain-markdown, r=oli-obkbors-0/+5
Add simple markdown formatting to `rustc --explain` output This is a second attempt at #104540, which is #63128 without dependencies. This PR adds basic markdown formatting to `rustc --explain` output when available. Currently, the output just displays raw markdown: this works of course, but it really doesn't look very elegant. (output is `rustc --explain E0038`) <img width="583" alt="image" src="https://github.com/rust-lang/rust/assets/13724985/ea418117-47af-455b-83c0-6fc59276efee"> After this patch, sample output from the same file: <img width="693" alt="image" src="https://github.com/rust-lang/rust/assets/13724985/12f7bf9b-a3fe-4104-b74b-c3e5227f3de9"> This also obeys the `--color always/auto/never` command option. Behavior: - If pager is available and supports color, print with formatting to the pager - If pager is not available or fails print with formatting to stdout - otherwise without formatting - Follow `--color always/never` if suppied - If everything fails, just print plain text to stdout r? `@oli-obk` cc `@estebank` (since the two of you were involved in the previous discussion)
2023-07-03Add a simple markdown parser for formatting `rustc --explain`Trevor Gross-0/+5
Currently, the output of `rustc --explain foo` displays the raw markdown in a pager. This is acceptable, but using actual formatting makes it easier to understand. This patch consists of three major components: 1. A markdown parser. This is an extremely simple non-backtracking recursive implementation that requires normalization of the final token stream 2. A utility to write the token stream to an output buffer 3. Configuration within rustc_driver_impl to invoke this combination for `--explain`. Like the current implementation, it first attempts to print to a pager with a fallback colorized terminal, and standard print as a last resort. If color is disabled, or if the output does not support it, or if printing with color fails, it will write the raw markdown (which matches current behavior). Pagers known to support color are: `less` (with `-r`), `bat` (aka `catbat`), and `delta`. The markdown parser does not support the entire markdown specification, but should support the following with reasonable accuracy: - Headings, including formatting - Comments - Code, inline and fenced block (no indented block) - Strong, emphasis, and strikethrough formatted text - Links, anchor, inline, and reference-style - Horizontal rules - Unordered and ordered list items, including formatting This parser and writer should be reusable by other systems if ever needed.
2023-07-02Auto merge of #113260 - flip1995:clippyup, r=Manishearthbors-17/+5
Update Clippy r? `@Manishearth` cc `@oli-obk` (for the ui-test changes in de69d556eb5006a21f868b8c12d48f0ef1308a5a and the valtree fix in 0cbe963e51faa7e3e771c1f9cea9aa443a648455) Fixes https://github.com/rust-lang/rust/issues/102093 This must've been the most involved Clippy sync ever.
2023-07-02Fix compile-test tests to work with the new ui_test cratePhilipp Krones-17/+5
2023-07-02Rollup merge of #113244 - Kobzol:bootstrap-rust-analyzer-tests, r=jyn514Matthias Krüger-1/+3
Make Rust Analyzer tests faster by compiling less code This should bring down the test duration of RA significantly.
2023-07-02Rollup merge of #113234 - jyn514:revert-python-test-args, r=clubby789Matthias Krüger-2/+3
Don't pass --test-args to `python -m unitest` The args for unittest and cargo test are mutually incompatible. Suggest that people use `python -m unittest ...` manually instead. This also changes `bootstrap_test.py` to be easier to run standalone; see the commit for details. r? `@clubby789` cc https://github.com/rust-lang/rust/pull/112281#discussion_r1248849172
2023-07-01Make Rust Analyzer tests faster by compiling less codeJakub Beránek-1/+3
2023-07-01Don't pass --test-args to `python -m unitest`jyn-2/+3
The args for unittest and cargo test are mutually incompatible. Suggest that people use `python -m unittest ...` manually instead. This also changes `bootstrap_test.py` to be easier to run standalone; see the commit for details.
2023-07-01Use RustOptimize to set optimizehi-rustin-1/+1
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2023-06-28Declare a `run-coverage-rustdoc` suite for coverage tests that need `rustdoc`Zalathar-0/+6
2023-06-28Declare a `run-coverage` test mode/suite in bootstrapZalathar-4/+10
2023-06-26Rollup merge of #113034 - jyn514:ci-progress, r=oli-obkMatthias Krüger-5/+7
Switch some more Steps to `builder.msg` In particular, this hides compiletest suites under a dropdown - some builders are configured with `verbose-tests`, which makes the suites take up many thousands of lines. before: ``` Documenting stage1 cargo (x86_64-unknown-linux-gnu) Check compiletest suite=rustdoc-js mode=js-doc-test (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu) ``` after: ``` ::group::Documenting stage1 cargo (x86_64-unknown-linux-gnu) ::group::Testing stage1 compiletest suite=rustdoc-js mode=js-doc-test (x86_64-unknown-linux-gnu) ``` found this from https://github.com/rust-lang-ci/rust/actions/runs/5366993848/jobs/9736792611 r? `@oli-obk`
2023-06-25fix some bugsjyn-0/+1
- fix tests when `--build` is set - don't leak `config.example.toml` fd - don't crash if `config.toml` doesn't exist yet
2023-06-25Switch some more Steps to `builder.msg`jyn-5/+7
In particular, this hides compiletest suites under a dropdown - some builders are configured with `verbose-tests`, which makes the suites take up many thousands of lines. before: ``` Documenting stage1 cargo (x86_64-unknown-linux-gnu) Check compiletest suite=rustdoc-js mode=js-doc-test (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu) ``` after: ``` ::group::Documenting stage1 cargo (x86_64-unknown-linux-gnu) ::group::Testing stage1 compiletest suite=rustdoc-js mode=js-doc-test (x86_64-unknown-linux-gnu) ```
2023-06-23Test cargo arguments passed by bootstrap.pyjyn-3/+2
This moves a lot of code around, but the logic itself is not too terribly complicated. - Move almost all logic in `def bootstrap` to the `RustBuild` class, to avoid mixing setting configuration with running commands - Update various doctests to the new (more complete) RustBuild config. In particular, don't pretend that `bin_root` supports `build` being unset. - Change `parse_args` not to use a global, to allow testing it - Set BUILD_DIR appropriately so bootstrap.py doesn't panic because cargo isn't found
2023-06-23Allow passing arguments to `bootstrap_test.py`jyn-1/+6
Previous, it used the built-in test runner, which doesn't support options unless they're manually passed in the script.
2023-06-23Make `try_run` return a `Result<(), ()>` instead of a booleanGuillaume Gomez-17/+21
2023-06-18Rollup merge of #112753 - Zalathar:no-bless, r=clubby789Michael Goulet-1/+2
Don't try to auto-bless 32-bit `mir-opt` tests on ARM Mac hosts #112418 added special support for automatically blessing 32-bit output on 64-bit hosts, for the subset of `mir-opt` tests that are pointer-width-dependent. This relies on the 64-bit host having some corresponding 32-bit target that can be built “easily”. For most 64-bit hosts this is fine, but ARM Macs don't have a corresponding 32-bit target. (There have never been 32-bit ARM Macs, and ARM Macs don't have the libraries needed for building `i686-apple-darwin`.) There is an entry for `("i686-apple-darwin", "aarch64-apple-darwin")` in the list of corresponding 32-bit platforms, but this doesn't actually work on ARM Macs. Instead, the bootstrap invocation fails to build the necessary 32-bit target support, and nothing gets tested or blessed. According to [this Zulip thread](https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/Can't.20bless.20any.20mir-opt.20tests.20on.20aarch64.20Mac/near/367109789), that mapping was only added because the author assumed it would work. But since it doesn't actually work on ARM Macs, the solution is to just remove that mapping. With the mapping removed, ARM Macs still can't auto-bless 32-bit output (they will see a warning instead), but at least they can now bless the output of `mir-opt` tests that don't care about pointer width.
2023-06-18Don't try to auto-bless 32-bit `mir-opt` tests on ARM Mac hostsZalathar-1/+2
Blessing 32-bit tests on 64-bit hosts relies on having a corresponding 32-bit target that can be built "easily" on those hosts. ARM Macs don't have a corresponding 32-bit target, so trying to build one is usually going to fail.
2023-06-16add dry_run checkDrMeepster-1/+1
2023-06-14Auto merge of #112418 - ferrocene:pa-mir-opt-panic, r=ozkanonur,saethlinbors-4/+104
Add support for targets without unwinding in `mir-opt`, and improve `--bless` for it The main goal of this PR is to add support for targets without unwinding support in the `mir-opt` test suite, by adding the `EMIT_MIR_FOR_EACH_PANIC_STRATEGY` comment. Similarly to 32bit vs 64bit, when that comment is present, blessed output files will have the `.panic-unwind` or `.panic-abort` suffix, and the right one will be chosen depending on the target's panic strategy. The `EMIT_MIR_FOR_EACH_PANIC_STRATEGY` comment replaced all the `ignore-wasm32` comments in the `mir-opt` test suite, as those comments were added due to `wasm32` being a target without unwinding support. The comment was also added on other tests that were only executed on x86 but were still panic strategy dependent. The `mir-opt` suite was then blessed, which caused a ton of churn as most of the existing output files had to be renamed and (mostly) duplicated with the abort strategy. --- After [asking on Zulip](https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/mir-opt.20tests.20and.20panic.3Dabort), the main concern about this change is it'd make blessing the `mir-opt` suite even harder, as you'd need to both bless it with an unwinding target and an aborting target. This exacerbated the current situation, where you'd need to bless it with a 32bit and a 64bit target already. Because of that, this PR also makes significant enhancements to `--bless` for the `mir-opt` suite, where it will automatically bless the suite four times with different targets, while requiring minimal cross-compilation. To handle the 32bit vs 64bit blessing, there is now an hardcoded list of target mapping between 32bit and 64bit. The goal of the list is to find a related target that will *probably* work without requiring additional cross-compilation toolchains on the system. If a mapping is found, bootstrap will bless the suite with both targets, otherwise just with the current target. To handle the panic strategy blessing (abort vs unwind), I had to resort to what I call "synthetic targets". For each of the target we're blessing (so either the current one, or a 32bit and a 64bit depending on the previous paragraph), bootstrap will extract the JSON spec of the target and change it to include `"panic-strategy": "abort"`. It will then build the standard library with this synthetic target, and bless the `mir-opt` suite with it. As a result of these changes, blessing the `mir-opt` suite will actually bless it two or four times with different targets, ensuring all possible variants are actually blessed. --- This PR is best reviewed commit-by-commit. r? `@jyn514` cc `@saethlin` `@oli-obk`
2023-06-13add another check for empty `cc`sPietro Albini-1/+1
2023-06-12implement stdout streaming in `render_tests::Renderer`ozkanonur-3/+3
Signed-off-by: ozkanonur <work@onurozkan.dev>
2023-06-12add support for blessing panic=abort mir-opt testsPietro Albini-2/+9
2023-06-12bless both 32bit and 64bit variants of mir-opt when availablePietro Albini-8/+70
2023-06-12allow mutating the c compilers detected by bootstrapPietro Albini-1/+1
This will be needed to create synthetic targets in future commits.
2023-06-12stop using a macro for the mir-opt test suitePietro Albini-2/+33