Commit Graph

298 Commits

Author SHA1 Message Date
Rune Tynan 18841ec342
Revert fmt version, add rustdoc-json-types to bootstrap tests 2021-03-06 15:50:30 -05:00
Joshua Nelson 05140ec091 Propagate `--test-args` for `x.py test src/tools/cargo` 2021-02-28 01:00:26 -05:00
Guillaume Gomez 50b39b2b65 Add new rustdoc-gui test suite 2021-02-21 14:21:04 +01:00
Joshua Nelson c583860126 Remove unnecessary `Option` in `default_doc`
Previously, there two different ways to encode the same info: `None` or
`Some(&[])`. Now there is only one way, `&[]`.
2021-02-14 11:31:35 -05:00
Mara Bos b5438e2230
Rollup merge of #81456 - Amanieu:remote-test-server, r=Amanieu
Make remote-test-server easier to use with new targets

While testing #81455 I encountered 2 issues with `remote-test-server`:
- It is built with the stage 0 toolchain, which does not support a newly added target.
- It overwrites `LD_LIBRARY_PATH` instead of appending to it, which prevents the use of a custom sysroot for target libraries.
2021-02-05 12:25:56 +01:00
Jack Huey 3b9d77c7b8
Rollup merge of #81603 - ehuss:error-index-build, r=Mark-Simulacrum
rustbuild: Don't build compiler twice for error-index-generator.

When using `--stage=1`, the error-index-generator was forcing the compiler to be built twice.  This isn't necessary; the error-index-generator just needs the same unusual logic that rustdoc uses to build with stage minus one.

`--stage=0` and `--stage=2` should be unaffected by this change.

cc #76371
2021-02-02 16:01:42 -05:00
Eric Huss 071d22760a rustbuild: Don't build compiler twice for error-index-generator. 2021-01-31 10:25:29 -08:00
Tomasz Miąsko 99eeb13e76 Remove remnants of the santizer runtime crates from bootstrap 2021-01-29 17:18:16 +01:00
Amanieu d'Antras a072ecbf70 Don't build remote-test-server with the stage0 toolchain
Newly added targets aren't available on the stage0 toolchain.
2021-01-27 23:08:15 +00:00
Rune Tynan ba6803e6b4
No longer require unstable for jsondocck, only build it for json tests 2021-01-19 19:28:28 -05:00
Rune Tynan 728ffc8c03
Address review v2 2021-01-19 17:02:34 -05:00
Rune Tynan 7715656edd
Add jsondocck tool, and use it for rustdoc JSON 2021-01-19 14:24:25 -05:00
Yuki Okushi 1c6593c473
Rollup merge of #80627 - bugadani:warn, r=Mark-Simulacrum
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-05 09:52:40 +09:00
Yuki Okushi 4c4e8e70bb
Rollup merge of #80533 - matthiaskrgr:bootstrap_clppy, r=Mark-Simulacrum
bootstrap: clippy fixes

addresses:

clippy::or_fun_call
clippy::single_char_add_str
clippy::comparison_to_empty
clippy::or_fun_call
2021-01-05 09:52:35 +09:00
Dániel Buga 6002e78392 Builder: Warn if test file does not exist 2021-01-04 16:09:59 +01:00
Pietro Albini 1fab57491d
bootstrap: change the dist outputs to GeneratedTarball
The struct will allow to store more context on the generated tarballs.
2020-12-31 11:38:05 +01:00
bors f0073a59cf Auto merge of #80435 - pietroalbini:compression-formats, r=Mark-Simulacrum
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-31 00:23:13 +00:00
Matthias Krüger 87423fbc6a bootstrap: clippy fixes
addresses:

clippy::or_fun_call
clippy::single_char_add_str
clippy::comparison_to_empty
clippy::or_fun_call
2020-12-31 00:58:52 +01:00
Pietro Albini 5526d90250
bootstrap: extract from any compression algorithm during distcheck 2020-12-30 16:20:23 +01:00
Vadim Petrochenkov 4d2d0bad4e Remove `compile-fail` test suite 2020-12-29 23:39:56 +03:00
David Wood 99ad915e32
compiletest: add split dwarf compare mode
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-16 10:33:51 +00:00
Nixon Enraght-Moony 1098cce27a Add tests for rustdoc json
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-01 18:34:39 +00:00
Mara Bos f45e6953d7
Rollup merge of #79527 - jyn514:intra-doc-tests, r=Manishearth
Move intra-doc link tests into a subdirectory

They were starting to get unwieldy.

r? ``@Manishearth``
2020-12-01 10:50:19 +00:00
Joshua Nelson 872acb0c35 Move `src/test/rustdoc-ui` intra-doc tests into a subdirectory
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-28 21:14:09 -05:00
Eric Huss d2d91b42a5 lint-docs: Add --validate flag to validate lint docs separately. 2020-11-28 13:39:02 -08:00
Josh Stone 566e8771a5 Make compiletest testing use the local sysroot
We already set `compiletest` to use the local sysroot in #68019, but
that missed the configuration for testing `compiletest` itself.
2020-11-18 14:41:27 -08:00
Jonas Schievink 194b96852f
Rollup merge of #78354 - 12101111:rustbuild_profiler, r=Mark-Simulacrum
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-11 20:58:56 +01:00
Mara Bos a619e25398
Rollup merge of #78706 - bjorn3:fix_run_make_without_llvm, r=Mark-Simulacrum
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-08 13:36:12 +01:00
Yuki Okushi 3f5723c6c5
Rollup merge of #78705 - Mark-Simulacrum:nicer-failure-compiletest, r=jyn514
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-07 01:02:16 +09:00
Mark Rousskov f289a87628 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.
2020-11-03 11:03:30 -05:00
bjorn3 39103ced58 Fix run-make tests running when LLVM is disabled 2020-11-03 16:55:33 +01:00
Joshua Nelson 1aedcd33f5 Suggest library/std when running all stage 0 tests 2020-11-02 17:35:52 -05:00
12101111 b989d46b48 Support enable/disable sanitizers/profiler per target 2020-10-26 10:34:07 +08:00
Jonas Schievink 77a7ccf869 bootstrap: configure native toolchain for run-make
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-19 16:37:04 +02:00
Yuki Okushi 83ee319822
Rollup merge of #76607 - Mark-Simulacrum:tidy-bins, r=pnkfelix
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-18 04:11:05 +09:00
Joshua Nelson b7080e6fd4 Give an error when running `x.py test --stage 0 src/test/ui` 2020-10-13 10:33:32 -04:00
Mark Rousskov cf33aad8fd Specify output directory for bootstrap tests 2020-09-20 16:39:13 -04:00
Mark Rousskov 1aac99de25 Provide bootstrap tools with RUSTC in environment 2020-09-20 16:39:13 -04:00
Pietro Albini b9af3e30a9
bootstrap: move the version number to a plaintext file
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-18 14:58:22 +02:00
Mark Rousskov 05c9c0ee5d 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.
2020-09-15 10:00:11 -04:00
Eric Huss 9dad908145 Fix generating rustc docs with non-default lib directory. 2020-09-14 14:42:56 -07:00
Mark Rousskov 3193d52a21 Remove host parameter from step configurations
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-11 08:59:01 -04:00
Vadim Petrochenkov b27fca71d4 rustbuild: Deduplicate LLD checks slightly 2020-09-07 00:40:07 +03:00
Vadim Petrochenkov 5118a51b4d rustbuild: Propagate LLD to more places when `use-lld` is enabled 2020-09-07 00:40:07 +03:00
Vadim Petrochenkov 8e6b563b93 rustbuild: Build tests with LLD if `use-lld = true` was passed (non-msvc) 2020-09-07 00:40:07 +03:00
Vadim Petrochenkov 77d11c3ce2 rustbuild: Build tests with LLD if `use-lld = true` was passed 2020-09-07 00:40:07 +03:00
mark 9e5f7d5631 mv compiler to compiler/ 2020-08-30 18:45:07 +03:00
Aleksey Kladov e6a2c8292b Allow --bess ing expect-tests in tools
See #75773 and #75775
2020-08-29 13:06:03 +02:00
Aleksey Kladov f7be59c593 Introduce expect snapshot testing library into rustc
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-24 15:38:42 +02:00
Eric Huss 73b7a04032 Fix crate-version with rustdoc in bootstrap. 2020-08-14 14:50:18 -07:00