summary refs log tree commit diff
path: root/src/bootstrap/test.rs
AgeCommit message (Collapse)AuthorLines
2022-09-19Enable RUSTC_BOOTSTRAP for a few stepsMark Rousskov-0/+3
2022-09-14jsondoclint: New ToolNixon Enraght-Moony-0/+2
2022-09-01Auto merge of #100606 - cuviper:upgrade-linux-ci, r=Mark-Simulacrumbors-1/+4
ci: Upgrade non-dist Linux testers from ubuntu:16.04 to 22.04 The main goal of updating to 22.04 is to get away from `llvm.allow-old-toolchain`. A side benefit is that they can also use the system `cmake` instead of building one.
2022-08-27Sunset RLSEric Huss-51/+0
2022-08-27Add replace-version-placeholder toolest31-0/+37
This tool is to be ran at specific points in the release process to replace the version place holder made by stabilizations with the version number.
2022-08-23rustbuild: fix version parsing for browser-ui-testJosh Stone-1/+4
2022-08-21Correct test-args to compiletest on Windowsczzrr-1/+9
2022-08-11Add instructions on how to update the browser-ui-test versionGuillaume Gomez-0/+5
2022-08-09Rollup merge of #100181 - RalfJung:alloc-ref-mutability, r=jackh726Dylan DPC-0/+4
add method to get the mutability of an AllocId Miri needs this for https://github.com/rust-lang/miri/issues/2463.
2022-08-07Auto merge of #100004 - jyn514:exclude-single-test, r=Mark-Simulacrumbors-0/+5
Move `x test --skip` to be part of `--exclude` `--skip` is inconsistent with the rest of the interface and redundant with `--exclude`. Fix --exclude to work properly for files and directories rather than having a separate flag. Fixes https://github.com/rust-lang/rust/issues/96342. cc https://github.com/rust-lang/rust/pull/96493#issuecomment-1200521720 r? `@Mark-Simulacrum`
2022-08-05propagate --bless to MiriRalf Jung-0/+4
2022-08-02Remove CARGO_TEST_DISABLE_GIT_CLIEric Huss-2/+0
This was a leftover from the Appveyor days.
2022-07-31Move `x test --skip` to be part of `--exclude`Joshua Nelson-0/+5
`--skip` is inconsistent with the rest of the interface and redundant with `--exclude`. Fix --exclude to work properly for files and directories rather than having a separate flag. If someone needs to use --skip for something other than compiletest, they can use `--test-args --skip` instead.
2022-07-28Build rust demangler before running run-make testsTomasz Miąsko-2/+6
2022-07-24Only run proc-macro-srv tests for now (after discussion with @Veykril, ↵Amos Wenger-4/+7
@jyn514, and @lnicola)
2022-07-24Don't run slow tests in Rust CI, only RA CIAmos Wenger-0/+4
2022-07-24Add comment about CARGO_WORKSPACE_DIRAmos Wenger-0/+2
2022-07-24Add test step for rust-analyzer, run it by defaultAmos Wenger-0/+49
2022-07-22miri: make --stage 0 testing workRalf Jung-0/+8
2022-07-07Rollup merge of #98994 - kons-9:dont_use_process_exit, r=jyn514Matthias Krüger-3/+3
replace process exit with more detailed exit in src/bootstrap/*.rs Fixes [#98830](https://github.com/rust-lang/rust/issues/98830) I implemeted "detail_exit.rs" in lib.rs, and replace all of std::process::exit. So, error code should panic in test code. ``` // lib.rs pub fn detail_exit(code: i32) -> ! { // Successful exit if code == 0 { std::process::exit(0); } if cfg!(test) { panic!("status code: {}", code); } else { std::panic::resume_unwind(Box::new(code)); } } ``` <details> <summary>% rg "exit\(" src/bootstrap/*.rs</summary> ``` builder.rs 351: crate::detail_exit(1); 1000: crate::detail_exit(1); 1429: crate::detail_exit(1); compile.rs 1331: crate::detail_exit(1); config.rs 818: crate::detail_exit(2); 1488: crate::detail_exit(1); flags.rs 263: crate::detail_exit(exit_code); 349: crate::detail_exit(exit_code); 381: crate::detail_exit(1); 602: crate::detail_exit(1); 616: crate::detail_exit(1); 807: crate::detail_exit(1); format.rs 35: crate::detail_exit(1); 117: crate::detail_exit(1); lib.rs 714: detail_exit(1); 1620: detail_exit(1); 1651:pub fn detail_exit(code: i32) -> ! { 1654: std::process::exit(0); sanity.rs 107: crate::detail_exit(1); setup.rs 97: crate::detail_exit(1); 290: crate::detail_exit(1); test.rs 676: crate::detail_exit(1); 1024: crate::detail_exit(1); 1254: crate::detail_exit(1); tool.rs 207: crate::detail_exit(1); toolstate.rs 96: crate::detail_exit(3); 111: crate::detail_exit(1); 182: crate::detail_exit(1); 228: crate::detail_exit(1); util.rs 339: crate::detail_exit(1); 378: crate::detail_exit(1); 468: crate::detail_exit(1); ``` </details>
2022-07-07squash the commitstoshiki goto-3/+3
implement detail_exit but I'm not sure it is right. not create new file and write detail exit in lib.rs replace std::process::exit to detail_exit that is not related to code runnning. remove pub
2022-07-05Rollup merge of #95503 - jyn514:build-single-crate, r=Mark-SimulacrumGuillaume Gomez-16/+16
bootstrap: Allow building individual crates This aims to be as unintrusive as possible, but did still require adding a new `tail_args` field to all `Rustc` and `Std` steps. New library and compiler crates are added to the sysroot as they are built, since it's useful to have e.g. just alloc and not std. Fixes https://github.com/rust-lang/rust/issues/44293.
2022-07-02Allow building single crates for the compiler and standard libraryJoshua Nelson-16/+16
- Add `Interned<Vec<String>>` and use it for tail args - Refactor `cache.rs` not to need a separate impl for each internable type
2022-07-02move optimize-tests flag handling from bootstrap to compiletestThe 8472-7/+1
2022-07-02Only obey optimize-tests flag on UI tests that are run-passThe 8472-1/+4
``` optimize-tests = false, master 25.98s optimize-tests = true, master 34.69s optimize-tests = true, patched 28.79s ``` Effects: - faster UI tests - llvm asserts get exercised less on build-pass tests - the difference between opt and nopt builds shrinks a bit - aux libs don't get optimized since they don't have a pass mode and almost never have explicit compile flags
2022-06-18Pass all paths to `Step::run` at once when using `ShouldRun::krate`Joshua Nelson-13/+22
This was surprisingly complicated. The main changes are: 1. Invert the order of iteration in `StepDescription::run`. Previously, it did something like: ```python for path in paths: for (step, should_run) in should_runs: if let Some(set) = should_run.pathset_for_path(path): step.run(builder, set) ``` That worked ok for individual paths, but didn't allow passing more than one path at a time to `Step::run` (since `pathset_for_paths` only had one path available to it). Change it to instead look at the intersection of `paths` and `should_run.paths`: ```python for (step, should_run) in should_runs: if let Some(set) = should_run.pathset_for_paths(paths): step.run(builder, set) ``` 2. Change `pathset_for_path` to take multiple pathsets. The goal is to avoid `x test library/alloc` testing *all* library crates, instead of just alloc. The changes here are similarly subtle, to use the intersection between the paths rather than all paths in `should_run.paths`. I added a test for the behavior to try and make it more clear. Note that we use pathsets instead of just paths to allow for sets with multiple aliases (*cough* `all_krates` *cough*). See the documentation added in the next commit for more detail. 3. Change `StepDescription::run` to explicitly handle 0 paths. Before this was implicitly handled by the `for` loop, which just didn't excute when there were no paths. Now it needs a check, to avoid trying to run all steps (this is a problem for steps that use `default_condition`). 4. Change `RunDescription` to have a list of pathsets, rather than a single path. 5. Remove paths as they're matched This allows checking at the end that no invalid paths are left over. Note that if two steps matched the same path, this will no longer run both; but that's a bug anyway. 6. Handle suite paths separately from regular sets. Running multiple suite paths at once instead of in separate `make_run` invocations is both tricky and not particularly useful. The respective test Steps already handle this by introspecting the original paths. Avoid having to deal with it by moving suite handling into a seperate loop than `PathSet::Set` checks.
2022-06-07Move beta rustfmt downloads to rustbuildJoshua Nelson-2/+2
2022-06-03Fully stabilize NLLJack Huey-6/+1
2022-05-30be less redundant redundantRalf Jung-4/+0
2022-05-30Let miri decide the flags to use for the test suiteOli Scherer-2/+0
2022-05-25Move download-rustc from bootstrap.py to rustbuildJoshua Nelson-2/+2
- Remove download-rustc handling from bootstrap.py - Allow a custom `pattern` in `builder.unpack()` - Only download rustc once another part of bootstrap depends on it. This is somewhat necessary since the download functions rely on having a full `Builder`, which isn't available until after config parsing finishes.
2022-05-08Auto merge of #96689 - gimbles:campfire, r=Mark-Simulacrumbors-0/+4
Move check-bootstrap from a makefile rule to test::Bootstrap Fixes #96688
2022-05-07Move check-bootstrap from a makefile rule to test::Bootstrapgimbles-0/+4
2022-05-05Don't constantly rebuild clippy on `x test src/tools/clippy`.Joshua Nelson-2/+0
This happened because the `SYSROOT` variable was set for `x test`, but not `x build`. Set it consistently for both to avoid unnecessary rebuilds.
2022-05-02Rollup merge of #96499 - jyn514:bootstrap-doctests, r=Mark-SimulacrumYuki Okushi-0/+11
Make it possible to write doctests for bootstrap This probably isn't super useful in practice, but it was easy to fix and avoids confusing errors about mismatched versions between beta and the default toolchain.
2022-04-27Make it possible to write doctests for bootstrapJoshua Nelson-0/+11
This probably isn't super useful in practice, but it was easy to fix and avoids confusing errors about mismatched versions between beta and the default toolchain.
2022-04-27Auto merge of #95170 - jyn514:ci-llvm, r=Mark-Simulacrumbors-7/+4
Move `download-ci-llvm` out of bootstrap.py This is ready for review. It has been tested on Windows, Linux, and NixOS. The second commit ports the changes from https://github.com/rust-lang/rust/pull/95234 to Rust; I can remove it if desired. Helps with https://github.com/rust-lang/rust/issues/94829. As a follow-up, this makes it possible to avoid downloading llvm until it's needed for building `rustc_llvm`; it would be nice to do that, but it shouldn't go in the first draft. It might also be possible to avoid requiring python until tests run (currently there's a check in `sanity.rs`), but I haven't looked too much into that. `@rustbot` label +A-rustbuild
2022-04-24Use `build/tmp` instead of adding a dependency on `tempfile`.Joshua Nelson-7/+4
2022-04-19compiletest: combine `--*-python` argsAlec Goncharow-3/+1
Since these arguments are now always the same, combine them into a singular `--python` argument.
2022-04-18Auto merge of #95906 - jyn514:enforce-valid-paths, r=Mark-Simulacrumbors-1/+1
Require all paths passed to `ShouldRun::paths` to exist on disk This has two benefits: 1. There is a clearer mental model of how bootstrap works. Steps correspond to paths on disk unless it's strictly impossible for them to do so (e.g. dist components). 2. Bootstrap has better checks for internal consistency. This caught several issues: - `src/sanitizers` doesn't exist; I changed it to just be a `sanitizers` alias. - `src/tools/lld` doesn't exist; I removed it, since `lld` alone already works. - `src/llvm` doesn't exist; removed it since `llvm` and `src/llvm-project` both work. - `src/lldb_batchmode.py` doesn't exist, it was moved to `src/etc`. - `install` was still using `src/librustc` instead of `compiler/rustc`. - None of the tools in `dist` / `install` allowed using `src/tools/X` to build them. This might be intentional - I can change them to aliases if you like. Builds on https://github.com/rust-lang/rust/pull/95901 and should not be merged before.
2022-04-18Auto merge of #96000 - jyn514:faster-doctests, r=Mark-Simulacrumbors-2/+4
Make `x test --stage 2 compiler/rustc_XXX` faster to run Previously, bootstrap unconditionally rebuilt the stage 2 compiler, even if it had previously built stage 1. This changes it to reuse stage 1 if possible. In particular, it no longer runs the following step: ``` Building stage1 compiler artifacts (x86_64-unknown-linux-gnu(x86_64-unknown-linux-gnu) -> x86_64-unknown-linux-gnu(x86_64-unknown-linux-gnu)) ```
2022-04-16Require all paths passed to `ShouldRun::paths` to exist on diskJoshua Nelson-1/+1
This has two benefits: 1. There is a clearer mental model of how bootstrap works. Steps correspond to paths on disk unless it's strictly impossible for them to do so (e.g. dist components). 2. Bootstrap has better checks for internal consistency. This caught several issues: - `src/sanitizers` doesn't exist; I changed it to just be a `sanitizers` alias. - `src/tools/lld` doesn't exist; I removed it, since `lld` alone already works. - `src/llvm` doesn't exist; removed it since `llvm` and `src/llvm-project` both work. - `src/lldb_batchmode.py` doesn't exist, it was moved to `src/etc`. - `install` was still using `src/librustc` instead of `compiler/rustc`. - None of the tools in `dist` / `install` allowed using `src/tools/X` to build them. This might be intentional - I can change them to aliases if you like.
2022-04-12Make `x test --stage 2 compiler/rustc_XXX` faster to runJoshua Nelson-2/+4
Previously, bootstrap unconditionally rebuilt the stage 2 compiler, even if it had previously built stage 1. This changes it to reuse stage 1 if possible.
2022-04-13Rollup merge of #95441 - AlecGoncharow:issue-95204-fix, r=Mark-SimulacrumDylan DPC-8/+1
Always use system `python3` on MacOS This PR includes 2 changes: 1. Always use the system Python found at `/usr/bin/python3` on MacOS 2. Removes the hard requirement on having `python` in your system path if you didn't specify alternatives. The proposed change will instead attempt to find and use in order: `python` -> `python3` -> `python2`. This change isn't strictly necessary but without any change to this check, the original issue inspiring this change will still exist. Fixes #95204 r? ```@jyn514```
2022-04-10Auto merge of #95253 - jyn514:cargo-run, r=Mark-Simulacrumbors-4/+0
Make it possible to run `cargo test` for bootstrap Note that this only runs bootstrap's self-tests, not compiler or library tests. Helps with https://github.com/rust-lang/rust/issues/94829.
2022-04-10Auto merge of #95502 - jyn514:doc-rustc, r=Mark-Simulacrumbors-30/+6
Fix `x doc compiler/rustc` This also has a few cleanups to `doc.rs`. The last two commits I don't care about, but the first commit I'd like to keep - it will be very useful for https://github.com/rust-lang/rust/issues/44293. Fixes https://github.com/rust-lang/rust/issues/95447.
2022-04-09Make it possible to run `cargo test` for bootstrapJoshua Nelson-4/+0
Note that this only runs bootstrap's self-tests, not compiler or library tests.
2022-04-09Rollup merge of #95369 - jyn514:test-rustdoc, r=Mark-SimulacrumDylan DPC-6/+29
Fix `x test src/librustdoc` with `download-rustc` enabled The problem was two-fold: - Bootstrap was hard-coding that unit tests should always run with stage1, not stage2, and - It hard-coded the sysroot layout in stage1, which puts libLLVM.so in `lib/rustlib/` instead of just `lib/`. This also takes the liberty of fixing `test src/librustdoc --no-doc`, which has been broken since it was first added. It would be nice at some point to unify this logic with other tests; I opened a Zulip thread: https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/Inconsistency.20in.20.60x.20test.60 Fixes https://github.com/rust-lang/rust/issues/91071.
2022-03-30Simplify `make_run` for `test::Crate` by introducing `crate_paths` instead ↵Joshua Nelson-30/+6
of calculating them after the fact
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.