about summary refs log tree commit diff
path: root/src/bootstrap/test.rs
AgeCommit message (Collapse)AuthorLines
2021-01-05Rollup merge of #80627 - bugadani:warn, r=Mark-SimulacrumYuki Okushi-1/+13
Builder: Warn if test file does not exist Running `./x.py test` with a file that does not exists (but where the path belongs to a test suite) silently ignores the missing file and runs the whole test suite. This PR prints a warning to reduce the potential surprise factor. Closes #80621
2021-01-05Rollup merge of #80533 - matthiaskrgr:bootstrap_clppy, r=Mark-SimulacrumYuki Okushi-1/+1
bootstrap: clippy fixes addresses: clippy::or_fun_call clippy::single_char_add_str clippy::comparison_to_empty clippy::or_fun_call
2021-01-04Builder: Warn if test file does not existDániel Buga-1/+13
2020-12-31bootstrap: change the dist outputs to GeneratedTarballPietro Albini-2/+5
The struct will allow to store more context on the generated tarballs.
2020-12-31Auto merge of #80435 - pietroalbini:compression-formats, r=Mark-Simulacrumbors-5/+2
Only produce .xz tarballs on CI This PR adds a `./configure` option to choose which tarball compression formats to produce, and changes our CI configuration to only produce `.xz` tarballs. The release process will then recompress everything into `.gz` when producing a release. This will drastically reduce our storage costs for CI artifacts, as we'd stop storing the same data twice. **Stable, beta and nightly releases will not be affected by this at all.** Before landing this we'll need to increase the VM size of our release process, to recompress everything in a reasonable amount of time. r? `@Mark-Simulacrum`
2020-12-31bootstrap: clippy fixesMatthias Krüger-1/+1
addresses: clippy::or_fun_call clippy::single_char_add_str clippy::comparison_to_empty clippy::or_fun_call
2020-12-30bootstrap: extract from any compression algorithm during distcheckPietro Albini-5/+2
2020-12-29Remove `compile-fail` test suiteVadim Petrochenkov-6/+0
2020-12-16compiletest: add split dwarf compare modeDavid Wood-1/+6
This commit adds a Split DWARF compare mode to compiletest so that debuginfo tests are also tested using Split DWARF in split mode (and manually in single mode). Signed-off-by: David Wood <david@davidtw.co>
2020-12-01Add tests for rustdoc jsonNixon Enraght-Moony-0/+7
Move rustdoc/rustdoc-json to rustdoc-json Scaffold rustdoc-json test mode Implement run_rustdoc_json_test Fix up python Make tidy happy
2020-12-01Rollup merge of #79527 - jyn514:intra-doc-tests, r=ManishearthMara Bos-32/+1
Move intra-doc link tests into a subdirectory They were starting to get unwieldy. r? ``@Manishearth``
2020-11-28Move `src/test/rustdoc-ui` intra-doc tests into a subdirectoryJoshua Nelson-32/+1
This also changes the builder to allow using `x.py test src/test/rustdoc-ui/intra-doc`; before, it would panic that no paths were found.
2020-11-28lint-docs: Add --validate flag to validate lint docs separately.Eric Huss-0/+33
2020-11-18Make compiletest testing use the local sysrootJosh Stone-1/+4
We already set `compiletest` to use the local sysroot in #68019, but that missed the configuration for testing `compiletest` itself.
2020-11-11Rollup merge of #78354 - 12101111:rustbuild_profiler, r=Mark-SimulacrumJonas Schievink-4/+4
Support enable/disable sanitizers/profiler per target This PR add options under `[target.*]` of `config.toml` which can enable or disable sanitizers/profiler runtime for corresponding target. If these options are empty, the global options under `[build]` will take effect. Fix #78329
2020-11-08Rollup merge of #78706 - bjorn3:fix_run_make_without_llvm, r=Mark-SimulacrumMara Bos-11/+15
Fix run-make tests running when LLVM is disabled The `--cc`, `--cxx`, `--cflags` and `--ar` flags were only passed to compiletest when `builder.config.llvm_enabled()` returned true. This is preventing me from running the tests on cg_clif.
2020-11-07Rollup merge of #78705 - Mark-Simulacrum:nicer-failure-compiletest, r=jyn514Yuki Okushi-0/+1
Print a summary of which test suite failed Especially on CI, where cross-compiling is common and single builder may end up with multiple hosts and multiple targets, it can be annoying to scroll back to the nearest start of test marker. This prints out a summary of the test suite being run directly in compiletest. For example, on a mir-opt failure, this would show something like this: ``` failures: [mir-opt] mir-opt/while-storage.rs test result: FAILED. 140 passed; 1 failed; 2 ignored; 0 measured; 0 filtered out Some tests failed in compiletest suite=mir-opt mode=mir-opt host=x86_64-unknown-linux-gnu target=x86_64-unknown-linux-gnu ``` Fixes #78517
2020-11-03Print a summary of which test suite failedMark Rousskov-0/+1
Especially on CI, where cross-compiling is common and single builder may end up with multiple hosts and multiple targets, it can be annoying to scroll back to the nearest start of test marker. This prints out a summary of the test suite being run directly in compiletest.
2020-11-03Fix run-make tests running when LLVM is disabledbjorn3-11/+15
2020-11-02Suggest library/std when running all stage 0 testsJoshua Nelson-1/+2
2020-10-26Support enable/disable sanitizers/profiler per target12101111-4/+4
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