about summary refs log tree commit diff
path: root/src/bootstrap/test.rs
AgeCommit message (Collapse)AuthorLines
2020-10-19bootstrap: configure native toolchain for run-makeJonas Schievink-1/+1
This allows moving a lot of run-make-fulldeps tests to just run-make tests, and allows running those on target-only platforms
2020-10-18Rollup merge of #76607 - Mark-Simulacrum:tidy-bins, r=pnkfelixYuki Okushi-0/+1
Modify executable checking to be more universal This uses a dummy file to check if the filesystem being used supports the executable bit in general. Supersedes #74753.
2020-10-13 Give an error when running `x.py test --stage 0 src/test/ui`Joshua Nelson-0/+9
2020-09-20Specify output directory for bootstrap testsMark Rousskov-0/+2
2020-09-20Provide bootstrap tools with RUSTC in environmentMark Rousskov-0/+2
2020-09-18bootstrap: move the version number to a plaintext filePietro Albini-1/+1
The Rust version number is currently embedded in bootstrap's source code, which makes it hard to update it automatically or access it outside of ./x.py (as you'd have to parse the source code). This commit moves the version number to a standalone plaintext file, which makes accessing or updating it trivial.
2020-09-15Modify executable checking to be more universalMark Rousskov-0/+1
This uses a dummy file to check if the filesystem being used supports the executable bit in general.
2020-09-14Fix generating rustc docs with non-default lib directory.Eric Huss-4/+4
2020-09-11Remove host parameter from step configurationsMark Rousskov-20/+18
rustc is a natively cross-compiling compiler, and generally none of our steps should care whether they are using a compiler built of triple A or B, just the --target directive being passed to the running compiler. e.g., when building for some target C, you don't generally want to build two stds: one with a host A compiler and the other with a host B compiler. Just one std is sufficient.
2020-09-07rustbuild: Deduplicate LLD checks slightlyVadim Petrochenkov-3/+3
2020-09-07rustbuild: Propagate LLD to more places when `use-lld` is enabledVadim Petrochenkov-1/+4
2020-09-07rustbuild: Build tests with LLD if `use-lld = true` was passed (non-msvc)Vadim Petrochenkov-0/+6
2020-09-07rustbuild: Build tests with LLD if `use-lld = true` was passedVadim Petrochenkov-3/+2
2020-08-30mv compiler to compiler/mark-1/+1
2020-08-29Allow --bess ing expect-tests in toolsAleksey Kladov-5/+0
See #75773 and #75775
2020-08-24Introduce expect snapshot testing library into rustcAleksey Kladov-0/+5
Snapshot testing is a technique for writing maintainable unit tests. Unlike usual `assert_eq!` tests, snapshot tests allow to *automatically* upgrade expected values on test failure. In a sense, snapshot tests are inline-version of our beloved UI-tests. Example: ![expect](https://user-images.githubusercontent.com/1711539/90888810-3bcc8180-e3b7-11ea-9626-d06e89e1a0bb.gif) A particular library we use, `expect_test` provides an `expect!` macro, which creates a sort of self-updating string literal (by using `file!` macro). Self-update is triggered by setting `UPDATE_EXPECT` environmental variable (this info is printed during the test failure). This library was extracted from rust-analyzer, where we use it for most of our tests. There are some other, more popular snapshot testing libraries: * https://github.com/mitsuhiko/insta * https://github.com/aaronabramov/k9 The main differences of `expect` are: * first-class snapshot objects (so, tests can be written as functions, rather than as macros) * focus on inline-snapshots (but file snapshots are also supported) * restricted feature set (only `assert_eq` and `assert_debug_eq`) * no extra runtime (ie, no `cargo insta`) See https://github.com/rust-analyzer/rust-analyzer/pull/5101 for a an extended comparison. It is unclear if this testing style will stick with rustc in the long run. At the moment, rustc is mainly tested via integrated UI tests. But in the library-ified world, unit-tests will become somewhat more important (that's why use use `rustc_lexer` library-ified library as an example in this PR). Given that the cost of removal shouldn't be too high, it probably makes sense to just see if this flies!
2020-08-14Fix crate-version with rustdoc in bootstrap.Eric Huss-1/+0
2020-08-12Add a script to verify the Platform Support page is up-to-date.Eric Huss-0/+44
2020-08-02compiletest: Support ignoring tests requiring missing LLVM componentsVadim Petrochenkov-15/+15
2020-07-30update MiriRalf Jung-1/+1
2020-07-28reenable tests after moving stdmark-10/+9
2020-07-27mv std libs to library/mark-10/+11
2020-07-19Auto merge of #74091 - richkadel:llvm-coverage-map-gen-4, r=tmandrybors-0/+4
Generating the coverage map @tmandry @wesleywiser rustc now generates the coverage map and can support (limited) coverage report generation, at the function level. Example commands to generate a coverage report: ```shell $ BUILD=$HOME/rust/build/x86_64-unknown-linux-gnu $ $BUILD/stage1/bin/rustc -Zinstrument-coverage \ $HOME/rust/src/test/run-make-fulldeps/instrument-coverage/main.rs $ LLVM_PROFILE_FILE="main.profraw" ./main called $ $BUILD/llvm/bin/llvm-profdata merge -sparse main.profraw -o main.profdata $ $BUILD/llvm/bin/llvm-cov show --instr-profile=main.profdata main ``` ![rust coverage report only 20200706](https://user-images.githubusercontent.com/3827298/86697299-1cbe8f80-bfc3-11ea-8955-451b48626991.png) r? @wesleywiser Rust compiler MCP rust-lang/compiler-team#278 Relevant issue: #34701 - Implement support for LLVMs code coverage instrumentation
2020-07-17Generating the coverage mapRich Kadel-0/+4
rustc now generates the coverage map and can support (limited) coverage report generation, at the function level. Example: $ BUILD=$HOME/rust/build/x86_64-unknown-linux-gnu $ $BUILD/stage1/bin/rustc -Zinstrument-coverage \ $HOME/rust/src/test/run-make-fulldeps/instrument-coverage/main.rs $ LLVM_PROFILE_FILE="main.profraw" ./main called $ $BUILD/llvm/bin/llvm-profdata merge -sparse main.profraw -o main.profdata $ $BUILD/llvm/bin/llvm-cov show --instr-profile=main.profdata main 1| 1|pub fn will_be_called() { 2| 1| println!("called"); 3| 1|} 4| | 5| 0|pub fn will_not_be_called() { 6| 0| println!("should not have been called"); 7| 0|} 8| | 9| 1|fn main() { 10| 1| let less = 1; 11| 1| let more = 100; 12| 1| 13| 1| if less < more { 14| 1| will_be_called(); 15| 1| } else { 16| 1| will_not_be_called(); 17| 1| } 18| 1|}
2020-07-17Teach bootstrap about target files vs target triplesJake Goulding-32/+37
`rustc` allows passing in predefined target triples as well as JSON target specification files. This change allows bootstrap to have the first inkling about those differences. This allows building a cross-compiler for an out-of-tree architecture (even though that compiler won't work for other reasons). Even if no one ever uses this functionality, I think the newtype around the `Interned<String>` improves the readability of the code.
2020-07-08Fix x.py test for librustc crates.Eric Huss-2/+2
2020-07-06Remove unused RUSTC_DEBUG_ASSERTIONSTomasz MiÄ…sko-2/+0
Since #73374 the rustc wrapper no longer configures debug assertions based on RUSTC_DEBUG_ASSERTIONS environment variable.
2020-06-29Compile rustdoc less often.Eric Huss-13/+47
2020-06-25Support configurable deny-warnings for all in-tree crates.Eric Huss-2/+4
2020-06-22Re-enable Clippy testsAaron Hill-4/+1
2020-06-19Rollup merge of #73352 - ehuss:bootstrap-metadata, r=Mark-SimulacrumRalf Jung-8/+2
Speed up bootstrap a little. The bootstrap script was calling `cargo metadata` 3 times (or 6 with `-v`). This is a very expensive operation, and this attempts to avoid the extra calls. On my system, a simple command like `./x.py test -h -v` goes from about 3 seconds to 0.4. An overview of the changes: - Call `cargo metadata` only once with `--no-deps`. Optional dependencies are filtered in `in_tree_crates` (handling `profiler_builtins` and `rustc_codegen_llvm` which are driven by the config). - Remove a duplicate call to `metadata::build` when using `-v`. I'm not sure why it was there, it looks like a mistake or vestigial from previous behavior. - Remove check for `_shim`, I believe all the `_shim` crates are now gone. - Remove check for `rustc_` and `*san` for `test::Crate::should_run`, these are no longer dependencies in the `test` tree. - Use relative paths in `./x.py test -h -v` output. - Some code cleanup (remove unnecessary `find_compiler_crates`, etc.). - Show suite paths (`src/test/ui/...`) in `./x.py test -h -v` output. - Some doc comments.
2020-06-15Disable clippy testsMark Rousskov-1/+4
2020-06-15Rollup merge of #73296 - ehuss:remove-msvc-aux, r=Mark-SimulacrumRalf Jung-7/+0
Remove vestigial CI job msvc-aux. This CI job isn't really doing anything, so it seems prudent to remove it. For some history: * This was introduced in #48809 when the msvc job was split in two to keep it under 2 hours (oh the good old days). At the time, this check-aux job did a bunch of things: * tidy * src/test/pretty * src/test/run-pass/pretty * src/test/run-fail/pretty * src/test/run-pass-valgrind/pretty * src/test/run-pass-fulldeps/pretty * src/test/run-fail-fulldeps/pretty * Tidy was removed in #60777. * run-pass and run-pass-fulldeps moved to UI in #63029 * src/test/pretty removed in #58140 * src/test/run-fail moved to UI in #71185 * run-fail-fulldeps removed in #51285 Over time through attrition, the job was left with one lonely thing: `src/test/run-pass-valgrind/pretty`. And of course, this wasn't actually running the "pretty" tests. The normal `run-pass-valgrind` tests ran, and then when it tried to run in "pretty" mode, all the tests were ignored because compiletest thought nothing had changed (apparently compiletest isn't fingerprinting the mode? Needs more investigation…). `run-pass-valgrind` is already being run as part of `x86_64-msvc-1`, so there's no need to run it here. I've taken the liberty of removing `src/test/run-pass-valgrind/pretty` as a distinct test. I'm guessing from the other PR's that the pretty tests should now live in `src/test/pretty`, and that the team has moved away from doing pretty tests on other parts of the `src/test` tree.
2020-06-14Switch bootstrap metadata to --no-deps.Eric Huss-6/+2
This should run much faster. There are also some drive-by cleanups here to try to simplify things. Also, the paths for in-tree crates are now displayed as relative in `x.py test -h -v`.
2020-06-13Speed up bootstrap a little.Eric Huss-3/+1
2020-06-12Remove vestigial CI job msvc-aux.Eric Huss-7/+0
2020-06-11Use the built cargo for cargotest.Eric Huss-1/+2
2020-06-07Try_run must only be used if toolstate is populatedMark Rousskov-1/+1
Clippy's tests were failing the build, but that failure was ignored in favor of checking toolstate. This is the correct behavior for toolstate-checked tools, but Clippy no longer updates its toolstate status as it should always build.
2020-06-02Auto merge of #72672 - seritools:remote-test-windows, r=Mark-Simulacrumbors-1/+1
Make remote-test-client and remote-test-server compatible with windows `compiletest` and `remote-test-client`: The command line for `remote-test-client` was changed slightly to allow cross-platform compatible paths. The old way of supplying the support libs was by joining their paths with the executable path with `:`. This caused Windows-style paths to be split after the directory letter. Now, the number of support libs is provided as a parameter as well, and the support lib paths are split off from the regular args in the client. `remote-test-server`: - Marked Unix-only parts as such and implemented Windows alternatives - On Windows `LD_LIBRARY_PATH` doesn't exist. Libraries are loaded from `PATH` though, so that's the way around it. - Tiny cleanup: `Command::args`/`envs` instead of manually looping over them - The temp path for Windows has to be set via environment variable, since there isn't a global temp directory that would work on every machine (as a static string)
2020-06-01bump Miri, update for cargo-miri being a separate projectRalf Jung-4/+11
2020-05-31Make `remote-test-client` work as cargo runner againDennis Duda-1/+1
Since cargo appends executable/args, the support_lib count parameter has to come first.
2020-05-27Clippy should always buildMark Rousskov-34/+26
This just unwraps clippy's build step instead of skipping tests if clippy didn't build. This matches e.g. cargo's behavior and seems more correct, as we always expect clippy to successfully build.
2020-05-24bootstrap: propagate test-args to miri and clippy test suitesRalf Jung-0/+4
2020-05-14Auto merge of #72058 - RalfJung:no-dist-lldb, r=Mark-Simulacrumbors-8/+3
bootstrap: remove lldb dist packaging The lldb-preview rustup package is missing on every single target, and has never been shipped beyond x86_64-apple-darwin. It was removed in #62592 which landed around a year ago, and there's not been demand that we re-enable it since, so we're now removing support entirely to cleanup the code a bit. The hope is that this will also kill the useless "lldb-preview" row on https://rust-lang.github.io/rustup-components-history/.
2020-05-11update miri some moreRalf Jung-1/+0
2020-05-10remove lldb package from bootstrap, config and build-manifestRalf Jung-8/+3
it's not been built since a long time ago
2020-05-06Remove code related to `test/run-fail`Yuki Okushi-9/+0
2020-05-03Remove clippy from some leftover lists of "possibly failing" toolsOliver Scherer-1/+1
2020-05-02Gate on clippy on CIOliver Scherer-3/+1
2020-04-22Build libstd with `-Cbitcode-in-rlib=yes`.Nicholas Nethercote-1/+1
So that the rlibs will work with both LTO and non-LTO builds.