about summary refs log tree commit diff
path: root/src/bootstrap/test.rs
AgeCommit message (Collapse)AuthorLines
2021-08-16Take into account jobs number for rustdoc gui testsGuillaume Gomez-0/+2
2021-08-03Add x.py option to --force-rerun compiletest testsSmitty-0/+4
2021-07-21Remove cargo workspace to build rustdoc-gui test crates because of cargo ↵Guillaume Gomez-11/+20
config not being applied
2021-07-21Auto merge of #82653 - jyn514:submodules-on-demand, r=Mark-Simulacrumbors-1/+4
Update all submodules that rustbuild doesn't depend on lazily This only updates the submodules the first time they're needed, instead of unconditionally the first time you run x.py. Ideally, this would move *all* submodules to rustbuild and not exclude some tools and backtrace. Unfortunately, cargo requires all `Cargo.toml` files in the whole workspace to be present to build any crate. On my machine, this takes the time for an initial submodule clone (for `x.py --help`) from 55.70 to 15.87 seconds. Helps with https://github.com/rust-lang/rust/issues/76653. Builds on https://github.com/rust-lang/rust/pull/86015 and should not be merged before (only the last commit is relevant).
2021-07-20Update all submodules that rustbuild doesn't depend on lazilyJoshua Nelson-1/+4
This only updates the submodules the first time they're needed, instead of unconditionally the first time you run x.py. Ideally, this would move *all* submodules and not exclude some tools and backtrace. Unfortunately, cargo requires all `Cargo.toml` files in the whole workspace to be present to build any crate. On my machine, this takes the time for an initial submodule clone (for `x.py --help`) from 55.70 to 15.87 seconds. This uses exactly the same logic as the LLVM update used, modulo some minor cleanups: - Use a local variable for `src.join(relative_path)` - Remove unnecessary arrays for `book!` macro and make the macro simpler to use - Add more comments
2021-07-12Simplify build system for rustdoc-gui test cratesGuillaume Gomez-14/+12
2021-07-07Clean up rustdoc static filesGuillaume Gomez-1/+1
2021-06-28Add new tool to check HTML:Guillaume Gomez-1/+44
* Make html-checker run by default on rust compiler docs as well * Ensure html-checker is run on CI * Lazify tidy binary presence check
2021-06-22Rollup merge of #86297 - GuillaumeGomez:rustdoc-gui-args, r=Mark-SimulacrumYuki Okushi-0/+3
Allow to pass arguments to rustdoc-gui tool Very convenient for testing. This is another part of https://github.com/rust-lang/rust/pull/86293 cc ``@jsha`` r? ``@Mark-Simulacrum``
2021-06-21Rollup merge of #86156 - ehuss:linkchecker-fixes, r=Mark-SimulacrumYuki Okushi-0/+17
Fix a bug in the linkchecker There was a small typo in the linkchecker (in #85652) that caused it to report a `#` fragment link error pointing to the wrong file (it was displaying the path to the source file, not the target of the link). This also includes a few other changes: - Fixes the tests due to some changes in the redirect handling in #84703. - Adds the tests to rustbuild to run whenever the linkchecker itself is run. - Updates the tests to validate more of the output (so that a mistake like this would have been caught). Closes #86144
2021-06-17Lazify is_really_default condition in the RustdocGUI bootstrap stepThe8472-3/+3
The `RustdocGUI::should_run` condition spawns `npm list` several times which adds up to seconds of wall-time. Evaluate the condition lazily to to keep `./x.py test tidy` and similar short-running tasks fast.
2021-06-16Allow to pass arguments to rustdoc-gui toolGuillaume Gomez-0/+3
2021-06-14Allow to run only a few GUI testsGuillaume Gomez-1/+8
2021-06-10Auto merge of #86098 - pietroalbini:test-stable, r=Mark-Simulacrumbors-0/+2
Add the x86_64-gnu-stable builder During the 1.52 release process we had to deal with some commits that passed the test suite on the nightly branch but failed on the beta or stable branch. In that case it was due to some UI tests including the channel name in the output, but other changes might also be dependent on the channel. This commit adds a new CI job that runs the Linux x86_64 test suite with the stable branch, ensuring nightly changes also work as stable. To ensure the new job works the following other changes are present: * The `ui-fulldeps/session-derive-errors.rs` test has been disabled on beta and stable, which required adding support for `// ignore-{channel}` and `// only-{channel}`. * The `rustdoc/intra-doc/field.rs` has been fixed. r? `@Mark-Simulacrum` fixes https://github.com/rust-lang/release-team/issues/11
2021-06-10Auto merge of #82639 - jyn514:stable-options, r=Mark-Simulacrumbors-1/+0
Don't pass -Z unstable-options by default for UI tests Unconditionally passing -Z unstable-options makes it impossible to test whether an option requires unstable-options or not. This uncovered quite a lot of bugs, I'll open issues for each. These don't strictly need to be fixed before this is merged, it just makes the diff much larger because of the changes to diagnostics. - https://github.com/rust-lang/rust/issues/82636 - https://github.com/rust-lang/rust/issues/82637 - https://github.com/rust-lang/rust/issues/82638
2021-06-09Test the linkchecker itself.Eric Huss-0/+17
2021-06-07build doctests with lld if use-lld = trueThe8472-15/+2
2021-06-07ignore ui-fulldeps/session-derive-errors.rs on beta and stablePietro Albini-0/+2
The session-derive-errors test ensures the internal SessionDiagnostic derive macro outputs the right error messages when misused. The macro relies on the proc_macro2 crate though, which changes its span behavior depending on whether the channel is nightly or not. This caused test failures when bumping the channel from nightly to beta/stable. Since SessionDiagnostic is internal-only we don't care about its diagnostics quality outside of nightly, as the compiler itself is developed on nightly. Thus the easiest solution is to ignore that test on the beta and stable channels. This also implements `// only-{channel}` and `// ignore-{channel}` in compiletest to properly support the change.
2021-06-06Don't pass -Z unstable-options by default for UI testsJoshua Nelson-1/+0
- Pass it explicitly where appropriate - Update stderr files and warnings; it turns that unstable-options has far-reaching effects on diagnostics.
2021-06-04rustdoc: link to stable/beta docs consistently in documentationJoshua Nelson-0/+1
## User-facing changes - Intra-doc links to primitives that currently go to rust-lang.org/nightly/std/primitive.x.html will start going to channel that rustdoc was built with. Nightly will continue going to /nightly; Beta will link to /beta; stable compilers will link to /1.52.1 (or whatever version they were built as). - Cross-crate links from std to core currently go to /nightly unconditionally. They will start going to /1.52.0 on stable channels (but remain the same on nightly channels). - Intra-crate links from std to std (or core to core) currently go to the same URL they are hosted at; they will continue to do so. Notably, this is different from everything else because it can preserve the distinction between /stable and /1.52.0 by using relative links. Note that "links" includes both intra-doc links and rustdoc's own automatically generated hyperlinks. ## Implementation changes - Update the testsuite to allow linking to /beta and /1.52.1 in docs - Use an html_root_url for the standard library that's dependent on the channel This avoids linking to nightly docs on stable. - Update rustdoc to use channel-dependent links for primitives from an unknown crate - Set DOC_RUST_LANG_ORG_CHANNEL from bootstrap to ensure it's in sync - Include doc.rust-lang.org in the channel
2021-06-03fix testing Miri with --stage 0Ralf Jung-2/+2
2021-05-26Enforce rustdoc-gui test-suite runGuillaume Gomez-48/+72
2021-05-14Update bootstrap for in-tree rustfmtJoshua Nelson-12/+4
- Add rustfmt to `x.py check` - Update Cargo.lock - Remove rustfmt from the toolstate list - Make rustfmt an in-tree tool - Give an error on `x.py test rustfmt` if rustfmt fails to build or if tests fail - Don't call `save_toolstate` when testing rustfmt
2021-05-11Make rustdoc-gui test suite able to run with different sub directoriesGuillaume Gomez-3/+3
2021-05-11Move rustdoc-gui rust libraries into their own folder and prepare the field ↵Guillaume Gomez-4/+17
for more libraries
2021-05-11Rollup merge of #84783 - jyn514:fmt-one, r=Mark-SimulacrumYuki Okushi-1/+1
Allow formatting specific subdirectories Fixes https://github.com/rust-lang/rust/issues/71094.
2021-05-07Don't stop running rustdoc-gui tests at first failureGuillaume Gomez-22/+8
2021-05-07Rollup merge of #84990 - GuillaumeGomez:sort-rustdoc-gui-tests, ↵Yuki Okushi-1/+6
r=Mark-Simulacrum Sort rustdoc-gui tests The rustdoc-gui tests were randomly run. Not really a big issue but I prefer the tests to be sorted.
2021-05-07Rollup merge of #84779 - jyn514:cargotest-args, r=Mark-SimulacrumYuki Okushi-0/+1
Add support for --test-args to cargotest This allows running a single test without having to wait for all tests to complete. Closes https://github.com/rust-lang/rust/issues/77260.
2021-05-07Rollup merge of #84500 - tmandry:compiletest-run-flag, r=Mark-SimulacrumDylan DPC-0/+5
Add --run flag to compiletest This controls whether run-* tests actually get run. r? ```@Mark-Simulacrum```
2021-05-06Sort rustdoc-gui testsGuillaume Gomez-1/+6
2021-05-05Rollup merge of #84865 - petrochenkov:llthread, r=Mark-SimulacrumRalf Jung-8/+15
rustbuild: Pass a `threads` flag that works to windows-gnu lld MinGW driver for COFF LLD doesn't currently translate GNU-style `--threads=N` to native `/threads:N`, so we have to pass the option in its native form to avoid an error. Also pass the `threads` flag to lld-link (windows-msvc lld) as well.
2021-05-04Auto merge of #83213 - rylev:update-lints-to-errors, r=nikomatsakisbors-0/+3
Update BARE_TRAIT_OBJECT and ELLIPSIS_INCLUSIVE_RANGE_PATTERNS to errors in Rust 2021 This addresses https://github.com/rust-lang/rust/pull/81244 by updating two lints to errors in the Rust 2021 edition. r? `@estebank`
2021-05-03rustbuild: Pass a `threads` flag that works to windows-gnu lldVadim Petrochenkov-8/+15
MinGW driver for COFF LLD doesn't currently translate GNU-style `--threads=N` to native `/threads:N`, so we have to pass the option in its native form to avoid an error. Also pass the `threads` flag to lld-link as well
2021-05-01Allow formatting specific subdirectoriesJoshua Nelson-1/+1
2021-05-01Add support for --test-args to cargotestJoshua Nelson-0/+1
This allows running a single test without having to wait for all tests to complete.
2021-04-30Add run flag to bootstrap testTyler Mandry-0/+5
2021-04-27Implement `x.py test src/tools/clippy --bless`Joshua Nelson-0/+20
- Add clippy_dev to the rust workspace Before, it would give an error that it wasn't either included or excluded from the workspace: ``` error: current package believes it's in a workspace when it's not: current: /home/joshua/rustc/src/tools/clippy/clippy_dev/Cargo.toml workspace: /home/joshua/rustc/Cargo.toml this may be fixable by adding `src/tools/clippy/clippy_dev` to the `workspace.members` array of the manifest located at: /home/joshua/rustc/Cargo.toml Alternatively, to keep it out of the workspace, add the package to the `workspace.exclude` array, or add an empty `[workspace]` table to the package's manifest. ``` - Change clippy's copy of compiletest not to special-case rust-lang/rust. Using OUT_DIR confused `clippy_dev` and it couldn't find the test outputs. This is one of the reasons why `cargo dev bless` used to silently do nothing (the others were that `CARGO_TARGET_DIR` and `PROFILE` weren't set appropriately). - Run clippy_dev on test failure I tested this by removing a couple lines from a stderr file, and they were correctly replaced. - Fix clippy_dev warnings
2021-04-26Pass unstable options to error index rustdoc invocationRyan Levick-0/+3
2021-04-09Auto merge of #81942 - the8472:reduce-ui-test-threads, r=Mark-Simulacrumbors-0/+2
reduce threads spawned by ui-tests The test harness already spawns enough tests to keep all cores busy. Individual tests should keep their own threading to a minimum to avoid context switch overhead. When running ui tests with lld enabled this shaves about 10% off that testsuite on my machine. Resolves #81946
2021-04-09reduce threads spawned by ui-testsThe8472-0/+2
the test harness already spawns enough tests for all cores, individual tests should keep their own threading to a minimum to avoid context switch overhead some tests fail with 1 CGU, so explicit compile flags have been added to keep their old behavior
2021-04-04Auto merge of #82347 - the8472:parallelize-tidy, r=Mark-Simulacrumbors-0/+1
Parallelize tidy Split off from #81833 While that PR brings wall time of `x.py test tidy` down to 0m2.847s adding this one on top should bring it down to 0m1.673s. r? `@Mark-Simulacrum` Previous concerns can be found at https://github.com/rust-lang/rust/pull/81833#issuecomment-782754685 and https://github.com/rust-lang/rust/pull/81833#discussion_r575194633
2021-04-03Address review comments and Windows failure, and make cleanerRich Kadel-0/+3
2021-04-03Make rust-demangler installableRich Kadel-1/+52
Adds bootstrap rules to support installing rust-demangler. When compiling with `-Z instrument-coverage`, the coverage reports are generated by `llvm-cov`. `llvm-cov` includes a built-in demangler for C++, and an option to supply an alternate demangler. For Rust, we have `rust-demangler`, currently used in `rustc` coverage tests. Fuchsia's toolchain for Rust is built via `./x.py install`. Fuchsia is adding support for Rust coverage, and we need to include the `rust-demangler` in the installed `bin` directory. Configured rust-demangler as an in-tree extended tool. Added tests to support `./x.py test rust-demangler`. Install with extended tools by default only if `profiler = true`.
2021-03-30bootstrap: don't complain about linkcheck if it is excludedTom Eccles-13/+13
We don't need to complain to the user about linkcheck having different hosts and targets when it is already excluded. This can be achieved by moving the check to when the step is run instead of in should_run.
2021-03-29Auto merge of #80839 - tblah:riscv64linux_links, r=Mark-Simulacrumbors-1/+15
Riscv64linux Test fixes Get tests passing again using the riscv64gc-unknown-linux-gnu docker image. Test with ``` src/ci/docker/run.sh riscv64gc-linux ``` ## linkcheck Linkcheck tests that interdocument links in the documentation are correct. Some interdocument links go between rustc and tools (such as rustdoc and cargo). When cross compiling, rustc is built for the host while some tools are built for the target. This goes for the documentation too. Because of this, links in the rustc documentation reffering to cargo or rustdoc documentation look broken. This issue is worked around by disabling linkcheck for cross compilation builds. ## run-make tests #78911 seems to happen because `--target` was not passed to `rustc`, but the target linker was specified, causing the target linker to be called with options intended for the host. Resolves #78911 In a separate issue, `issue-36710` was trying to run a binary built for the target on the host system. This will not work for any platform using `remote-test-server`/`client` (such as riscv64). I don't know of a way of skipping those platforms specifically, so I set this test to skip only on riscv64 for now.
2021-03-28bootstrap: don't run linkcheck when crosscompilingTom Eccles-1/+15
When we cross compile, some things (and their documentation) are built for the host (e.g. rustc), while others (and their documentation) are built for the target. This generated documentation will have broken links between documentation for different platforms e.g. between rustc and cargo.
2021-03-27Run Miri test suite with mir-opt-level=4Ralf Jung-1/+8
2021-03-15Make bootstrap be more informative when one does `x.py test` on a beta ↵Felix S. Klock II-0/+13
checkout without other mods. To be clear, by default running `x.py test` on a checkout of the beta branch currently fails, and with this change will continue to fail, because `x.py tests` runs `x.py test src/tools/tidy` which tries to run `rustfmt` and that will fail because the `rustfmt` binary is pinned to the current nighlty and we do not attempt to distribute one for the beta builds. This change gives a better error message than the current message, which is just "./x.py fmt is not supported on this channel" without providing any hint about what one might do about that problem. (update: placated tidy.)
2021-03-10Rollup merge of #82802 - jyn514:build-rustdoc-fullmake, r=Mark-SimulacrumYuki Okushi-1/+1
Build rustdoc for run-make tests, not just run-make-fulldeps Rustdoc almost never needs a full stage 2 compiler, and requiring rustdoc tests to be in run-make-fulldeps adds a lot of compile time for no reason. This is the same change from https://github.com/rust-lang/rust/pull/81197, but separated into its own PR. I ran into this again today while working on https://github.com/rust-lang/docs.rs/issues/1302. r? ```@Mark-Simulacrum```