about summary refs log tree commit diff
path: root/src/bootstrap/test.rs
AgeCommit message (Collapse)AuthorLines
2022-03-29Don't build the full compiler before running unit testsJoshua Nelson-1/+0
This has been present since `builder.ensure` was first added in https://github.com/rust-lang/rust/pull/43059. It's unclear to me why it was added then - I tested these changes locally with `x test compiler/rustc_data_structures --stage 0` and they worked fine. Fixes https://github.com/rust-lang/rust/issues/51748.
2022-03-18Compare installed browser-ui-test version to the one used in CIGuillaume Gomez-17/+41
2022-03-07copy over `std::path::absolute` instead of adding `canonicalize` hacksJoshua Nelson-1/+1
this also fixes a bug where bootstrap would try to use the fake `rustc` binary built by bootstrap - cargo puts it in a different directory when using `cargo run` instead of x.py
2022-03-07fix weird bug when `out` would get overridden by unit testsJoshua Nelson-0/+2
2022-03-05Merge build_helper into utilbjorn3-5/+2
2022-03-05Remove build_helperbjorn3-2/+1
The majority of the code is only used by either rustbuild or rustc_llvm's build script. Rust_build is compiled once for rustbuild and once for every stage. This means that the majority of the code in this crate is needlessly compiled multiple times. By moving only the code actually used by the respective crates to rustbuild and rustc_llvm's build script, this needless duplicate compilation is avoided.
2022-03-03bootstrap: correct reading of flags for llvmJon Gjengset-3/+12
First, this reverts the `CFLAGS`/`CXXFLAGS` of #93918. Those flags are already read by `cc` and populated into `Build` earlier on in the process. We shouldn't be overriding that based on `CFLAGS`, since `cc` also respects overrides like `CFLAGS_{TARGET}` and `HOST_CFLAGS`, which we want to take into account. Second, this adds the same capability to specify target-specific versions of `LDFLAGS` as we have through `cc` for the `C*` flags: https://github.com/alexcrichton/cc-rs#external-configuration-via-environment-variables Note that this also necessitated an update to compiletest to treat CXXFLAGS separately from CFLAGS.
2022-01-21Override rustc version in ui and mir-opt tests to get stable hashesThe 8472-0/+3
Building a dozen separate regexps for each test in compiletest consumes significant amounts of CPU cycles. Using `RUSTC_FORCE_INCR_COMP_ARTIFACT_HEADER` stabilizes hashes calcuated for the individual tests so no test-dependent normalization is needed. Hashes for the standard library still change so some normalizations are still needed.
2021-11-10Update more rustc/libtest things for wasm64Alex Crichton-1/+1
* Add wasm64 variants for inline assembly along the same lines as wasm32 * Update a few directives in libtest to check for `target_family` instead of `target_arch` * Update some rustc codegen and typechecks specialized for wasm32 to also work for wasm64.
2021-11-09Allow to run a specific rustdoc-js* testGuillaume Gomez-33/+20
2021-10-10Rollup merge of #89520 - GuillaumeGomez:cache-rustdoc-gui-test, ↵Matthias Krüger-1/+1
r=Mark-Simulacrum Don't rebuild GUI test crates every time you run test src/test/rustdoc-gui This method has multiple advantages: * It'll completely remove the rustdoc-GUI test doc folder if rustdoc was updated * It'll rebuild GUI test crates only they have been updated All in all, it's quite convenient! (even more with https://github.com/rust-lang/rust/pull/88816) r? ```@Mark-Simulacrum```
2021-10-07Remove unused clippy bootstrap env varsCameron Steffen-8/+1
2021-10-04Don't rebuild GUI test crates every time you run test src/test/rustdoc-guiGuillaume Gomez-1/+1
2021-09-20Adjust to SourceType::InTree in several placesMark Rousskov-1/+1
These were left over in migrations to subtrees, which should generally be treated as-if it was local. Also fixes a warning caused by this change.
2021-09-13 * Enable generate-link-to-def feature on a rustdoc GUI testGuillaume Gomez-0/+5
* Add test for jump-to-def links background color
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