about summary refs log tree commit diff
path: root/src/tools/compiletest
AgeCommit message (Collapse)AuthorLines
2024-10-13Move debugger setup code out of `lib.rs`Zalathar-274/+290
2024-10-13Error on trying to use revisions in `run-make` tests许杰友 Jieyou Xu (Joe)-5/+14
Currently `run-make` tests do not support revisions.
2024-10-13Remove the one thing that was checking a directive's `original_line`Zalathar-28/+4
2024-10-13Rename `HeaderLine` to `DirectiveLine`Zalathar-8/+13
2024-10-11Include all kinds of auxiliary crates in the up-to-date timestampZalathar-1/+17
This was previously only including ordinary `aux-build` crates, and not files associated with the other three kinds of auxiliary crate.
2024-10-11Use the same `AuxProps` parser for `EarlyProps`Zalathar-28/+9
2024-10-11Extract auxiliary-crate properties to their own module/structZalathar-40/+62
2024-10-11Rollup merge of #131525 - Zalathar:emit-asm, r=jieyouxuStuart Cook-17/+8
compiletest: Simplify the choice of `--emit` mode for assembly tests Tiny little cleanup that I noticed while working on #131524. No functional change. Historically, the original code structure (#58791) predates the `Emit` enum (#103298), so it was manually adding `--emit` flags to the compiler invocation. But now the match can just evaluate to the appropriate `Emit` value directly.
2024-10-11Simplify the choice of `--emit` mode for assembly testsZalathar-17/+8
2024-10-11compiletest: Remove the magic hacks for finding output with `lto=thin`Zalathar-50/+6
This hack was intended to handle the case where `-Clto=thin` causes the compiler to emit multiple output files (when producing LLVM-IR or assembly). The hack only affects 4 tests, of which 3 are just meta-tests for the hack itself. The one remaining test that motivated the hack currently doesn't even need it! (`tests/codegen/issues/issue-81408-dllimport-thinlto-windows.rs`)
2024-10-10Rollup merge of #131470 - EnzymeAD:enzyme-testinfra2, r=jieyouxuMatthias Krüger-0/+7
add test infra to explicitely test rustc with autodiff/enzyme disabled I assume this is not what you want for now, but I'll update the PR once I understand how the ignore- directives work. To summarize the situation, we want a feature gate test where we don't enable the autodiff feature using `#![feature(autodiff)]`. There are two situations. 1) We have a rustc which was build without autodiff support (current default): It gives one error about the feature being needed and one error about this rustc version being build without autodiff support. 2) We have a rustc which was build with autodiff support (i.e. for now a custom build): It gives one error about the feature being needed. We have a `//`````@needs-enzyme`````` directive which we can use in revisions for the second case. However, we have no way to specify that needs-enzyme implies that the second error should not be seen. This ads a way of passing the following test: ``` //@ revisions: has_support no_support //`````@[has_support]````` needs-enzyme //`````@[no_support]````` needs-enzyme-disabled #![crate_type = "lib"] #[autodiff(dfoo, Reverse)] //[has_support]~^ ERROR use of unstable library feature 'autodiff' [E0658] //[no_support]~^^ ERROR use of unstable library feature 'autodiff' [E0658] //[no_support]~| ERROR this rustc version does not support autodiff fn foo() {} ``` Cherry picking this PR to my frontend pr makes the test above pass in both configurations (enzyme=true/false in config.toml). I'm open to other changes that make this testcase pass. r? `````@jieyouxu````` Tracking: - https://github.com/rust-lang/rust/issues/124509
2024-10-10add config to explicitely test rustc with autodiff/enzyme disabledManuel Drehwald-0/+7
2024-10-09Rollup merge of #131382 - ehuss:compiletest-reference, r=jieyouxuMatthias Krüger-0/+1
Add "reference" as a known compiletest header This adds the "reference" compiletest header so that the Rust reference can add annotations to the test suite in order to link tests to individual rules in the reference. Tooling in the reference repo will be responsible for collecting these annotations and linking to the tests. More details are in MCP 783: https://github.com/rust-lang/compiler-team/issues/783 There is a change from the MCP in that I am not adding the JSON collection to compiletest (at least, not yet). In looking at this more closely, that actually makes things more difficult for our tooling, so I'm leaving it out for now. If in the future it looks like something we want, then I think we can add it later. There are a few tests here which need adjusting due to the legacy header check. `@jieyouxu` indicated on Zulip that we could potentially remove the legacy header check, in which case those changes can be dropped from this PR. r? `@jieyouxu`
2024-10-09Add "reference" as a known compiletest headerEric Huss-0/+1
This adds the "reference" compiletest header so that the Rust reference can add annotations to the test suite in order to link tests to individual rules in the reference. Tooling in the reference repo will be responsible for collecting these annotations and linking to the tests. More details are in MCP 783: https://github.com/rust-lang/compiler-team/issues/783
2024-10-09No need to cache the `profiler_runtime` flagZalathar-3/+1
This cache struct entry was a relic from when profiler availability was communicated via an environment variable rather than a command-line flag.
2024-10-09Rename `profiler_support` to `profiler_runtime` throughout compiletestZalathar-18/+18
2024-10-09Rename directive `needs-profiler-support` to `needs-profiler-runtime`Zalathar-7/+7
2024-10-08Rollup merge of #131400 - Zalathar:ignore-coverage, r=jieyouxuMatthias Krüger-19/+14
Simplify the compiletest directives for ignoring coverage-test modes Follow-up to #131346. Given that these directives are now restricted to ignoring coverage-test modes only, we can drop the clunky `ignore-mode-*` naming convention, and just call them `ignore-coverage-map` and `ignore-coverage-run`. r? jieyouxu
2024-10-08Simplify the directives for ignoring coverage-test modesZalathar-19/+14
2024-10-08Drop compiletest legacy directive checks许杰友 Jieyou Xu (Joe)-93/+48
Sufficient time has passed (> 6 months) since we migrated from `//` to `//@`, so let's drop the legacy directive check as it causes friction due to false positives.
2024-10-07Rollup merge of #131351 - jieyouxu:yeet-the-valgrind, r=KobzolJubilee-95/+29
Remove valgrind test suite and support from compiletest, bootstrap and opt-dist The `run-pass-valgrind` test suite is not exercised in CI, and as far as I'm aware nobody runs it (asked in https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/Are.20the.20valgrind.20tests.20even.20used.20by.20anyone.3F). What's remaining of valgrind support in compiletest isn't even properly hooked up with bootstrap. The existing valgrind logic in compiletest is also straight up questionable, i.e. https://github.com/rust-lang/rust/blob/1b3b8e7b0265162853c650ead09905bc3cdaeae9/src/tools/compiletest/src/runtest/valgrind.rs#L7-L12 It just runs valgrind tests as `rpass` if no valgrind path is provided to compiletest from bootstrap -- but bootstrap doesn't even pass a valgrind path to compiletest in the first place, so this always ran as `rpass` tests. So what is this even testing? So if it's not testing anything, let's delete it. Closes #44816 by deleting the test suite :3 <img src="https://github.com/user-attachments/assets/99525bf7-e85b-40ba-9281-e4e1e275c4e8" width=300 />
2024-10-07Rollup merge of #131353 - GuillaumeGomez:check_rustdoc_test_option, r=jieyouxuMatthias Krüger-0/+4
Add documentation for `runtest::check_rustdoc_test_option` method r? `@jieyouxu`
2024-10-07Add documentation for `runtest::check_rustdoc_test_option` methodGuillaume Gomez-0/+4
2024-10-07Remove valgrind test suite and support from compiletest许杰友 Jieyou Xu (Joe)-95/+29
2024-10-07Prune invalid `ignore-mode-*` directives许杰友 Jieyou Xu (Joe)-21/+3
These are only valid for coverage test modes.
2024-09-29add has_enzyme/needs-enzyme to the test infraManuel Drehwald-0/+15
2024-09-29Auto merge of #129687 - Urgau:rfc3127-sysroot-2, r=jieyouxubors-4/+15
Implement RFC3137 trim-paths sysroot changes - take 2 This PR is a continuation of https://github.com/rust-lang/rust/pull/118149. Nothing really changed, except for https://github.com/rust-lang/rust/pull/129408 which I was able to trigger locally. Original description: > Implement parts of #111540 > > Right now, backtraces into sysroot always shows /rustc/$hash in diagnostics, e.g. > > ``` > thread 'main' panicked at 'hello world', map-panic.rs:2:50 > stack backtrace: > 0: std::panicking::begin_panic > at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/std/src/panicking.rs:616:12 > 1: map_panic::main::{{closure}} > at ./map-panic.rs:2:50 > 2: core::option::Option<T>::map > at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/core/src/option.rs:929:29 > 3: map_panic::main > at ./map-panic.rs:2:30 > 4: core::ops::function::FnOnce::call_once > at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/core/src/ops/function.rs:248:5 > note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace. > ``` > > [RFC 3127 said](https://rust-lang.github.io/rfcs/3127-trim-paths.html#changing-handling-of-sysroot-path-in-rustc) > > > We want to change this behaviour such that, when rust-src source files can be discovered, the virtual path is discarded and therefore the local path will be embedded, unless there is a --remap-path-prefix that causes this local path to be remapped in the usual way. > > This PR implements this behaviour. When `rust-src` is present at compile time, rustc replaces /rustc/$hash with a real path into local rust-src with best effort. To sanitise this, users must explicitly supply `--remap-path-prefix=<path to rust-src>=foo`. cc `@cbeuw` Fix #105907 Fix #85463 try-job: dist-x86_64-linux try-job: x86_64-msvc try-job: dist-x86_64-msvc try-job: armhf-gnu
2024-09-28compiletest: normalize to `$SRC_DIR_REAL` before `$TEST_BUILD_DIR`Urgau-6/+6
in case the real paths into the libstd/libcore are located inside the the build directory, maybe because it's coming from an extracted dist component in the build dir (cc opt-dist)
2024-09-28compiletest: rename "runtest/crash.rs" to "runtest/crashes.rs" to be in line ↵Matthias Krüger-1/+1
with the test directory r? jieyouxu
2024-09-27compiletest: fallback to the original path if it's not a symlinkUrgau-11/+6
2024-09-27Implement RFC3137 trim-paths sysroot changesUrgau-3/+19
2024-09-27bump few depsklensy-1/+1
cargo_metadata, thorin-dwp, windows
2024-09-24Mention `COMPILETEST_VERBOSE_CRASHES` on crash test failure许杰友 Jieyou Xu (Joe)-4/+5
2024-09-23Rollup merge of #129545 - notriddle:notriddle/toolbar-v2, r=GuillaumeGomezMichael Goulet-1/+1
rustdoc: redesign toolbar and disclosure widgets Fixes #77899 Fixes #90310 ## Preview | before | after | ------ | ----- | ![image](https://github.com/user-attachments/assets/ebeec185-3a72-481d-921e-a9a885f348d9) | ![image](https://github.com/user-attachments/assets/08735a65-99d1-4523-ab77-ddb164c0a5db) | ![image](https://github.com/user-attachments/assets/ae8e0f24-49cb-445d-b9bd-cec9c57b94e7) | ![image](https://github.com/user-attachments/assets/ba484f94-b031-41fc-b8a8-6cd81be8fb6b) | ![image](https://github.com/user-attachments/assets/8c2cc041-a138-4950-a12e-3d529c8a5339) | ![image](https://github.com/user-attachments/assets/e7f010bd-19e2-4711-85bf-3fd00c3e5647) | ![image](https://github.com/user-attachments/assets/e2b63785-971c-489e-b069-eb85f6a30620) | ![image](https://github.com/user-attachments/assets/b65eea16-d6a3-4aa3-8a27-6ded74009010) | ![image](https://github.com/user-attachments/assets/1c7b0901-a61a-4325-9d01-9d8b14b476aa) | ![image](https://github.com/user-attachments/assets/d4a485db-d9f1-4a62-94bc-a3d125ea6dc1) | N/A | ![image](https://github.com/user-attachments/assets/7add0a2a-7fd7-483d-87ee-51ee45a2fe5d) | ![image](https://github.com/user-attachments/assets/334f50bc-9f8d-42d9-a7df-95058f7cdfd5) | ![image](https://github.com/user-attachments/assets/451fcc22-b034-453c-ae4b-b948fd6bd779) | ![image](https://github.com/user-attachments/assets/132f720c-802a-466d-bd55-c7a4750acdc3) | ![image](https://github.com/user-attachments/assets/177b7921-06c5-467d-87d3-9cdf88c4e50b) https://notriddle.com/rustdoc-html-demo-12/toolbar-v2/std/index.html ## Description This adds labels to the icons and moves them away from the search box. These changes are made together, because they work together, but are based on several complaints: * The [+/-] thing are a Reddit-ism. They don't look like buttons, but look like syntax <https://rust-lang.zulipchat.com/#narrow/stream/266220-t-rustdoc/topic/More.20visual.20difference.20for.20the.20.2B.2F-.20.20Icons>, <https://github.com/rust-lang/rust/issues/59851> (some of these are laundry lists with more suggestions, but they all mention [+/-] looking wrong) * The settings, help, and summary buttons are also too hard to recognize <https://lwn.net/Articles/987070/>, <https://github.com/rust-lang/rust/issues/90310>, <https://github.com/rust-lang/rust/issues/14475#issuecomment-274241997>, <https://internals.rust-lang.org/t/improve-rustdoc-design/12758> ("Not all functionality is self-explanatory, for example the [+] button in the top right corner, the theme picker or the settings button.") The toggle-all and toggle-individual buttons both need done at once, since we want them to look like they go together. This changes them from both being [+/-] to both being arrows. CC <https://github.com/rust-lang/rust/pull/113074#issuecomment-1677469680> and ``@jsha`` regarding the use of triangles for disclosure, which is what everyone wanted, but was pending a good toggle-all button. This PR adds a toggle-all button that should work. Settings and Help are also migrated, so that the whole group can benefit from being described using actual words. The breadcrumbs also get redesigned, so that they use less space, by shrinking the parent module path parts. This is done at the same time as the toolbar redesign because it's, effectively, moving space from the toolbar to the breadcrumbs. This is aimed at avoiding any line wrapping at desktop sizes. ## Prior art This style of toolbar, with explicit labels on the buttons, used to be more popular. It's not very common in web browsers nowadays, and for truly universal icons like :arrow_left: I can understand why, but words are great when icons fail. ![image](https://github.com/user-attachments/assets/9a4a0498-232d-4d60-87b9-f601f4515254)
2024-09-22Reformat using the new identifier sorting from rustfmtMichael Goulet-30/+29
2024-09-20Pass the current cargo to `run-make` testsJosh Stone-0/+14
A couple tests were using `BOOTSTRAP_CARGO` with `-Zbuild-std`, but that stage0 cargo might not always be in sync with in-tree changes. In particular, those tests started failing on the beta branch because the older cargo couldn't find the library `Cargo.lock`, and then couldn't build the latest version of `compiler_builtins` that had nightly changes.
2024-09-20Rollup merge of #130566 - jieyouxu:breakup-runtest, r=compiler-errorsGuillaume Gomez-2041/+2156
Break up compiletest `runtest.rs` into smaller helper modules Previously compiletest's `runtest.rs` was a massive 4700 lines file that made reading and navigation very awkward. This PR breaks the `runtest.rs` file up into smaller helper modules, one for each test suite/mode. > [!NOTE] > This PR should not contain functional changes, it is intended to be mostly code motion to breakup `runtest.rs` into smaller helper modules to make it easier to digest. > > This PR intentionally does not neatly reorganize where all the methods on `TestCx` goes, that is intended for a follow-up PR. Some methods on `TestCx` do not need to be on `TestCx`. It also does not address a weirdness in valgrind, that is intended for a follow-up PR as well. Part of a series of compiletest cleanups #130565. Fixes #89475. r? `@ghost` (I need to do a self-review pass first)
2024-09-19Fix compiletest doc comments许杰友 Jieyou Xu (Joe)-6/+6
2024-09-19Break up compiletest runtest.rs into smaller helper modules许杰友 Jieyou Xu (Joe)-2041/+2156
Previously compiletest's `runtest.rs` was a massive 4700 lines file that made reading and navigation very awkward. This commit intentionally does not neatly reorganize where all the methods on `TestCx` goes, that is intended for a follow-up PR.
2024-09-12Re-run coverage tests if `coverage-dump` was modifiedZalathar-0/+6
2024-09-11Rollup merge of #130161 - onur-ozkan:fmt-changed-files, r=Kobzol,RalfJungMatthias Krüger-2/+15
refactor merge base logic and fix `x fmt` When remote upstream is not configured, using [get_git_modified_files](https://github.com/rust-lang/rust/blob/38e3a5771cefc9362976a605549f8b04d5707311/src/tools/build_helper/src/git.rs#L114) to find modified files fails because [get_rust_lang_rust_remote](https://github.com/rust-lang/rust/blob/38e3a5771cefc9362976a605549f8b04d5707311/src/tools/build_helper/src/git.rs#L46-L48) can not resolve "rust-lang/rust" from the git output. The changes in this PR makes bootstrap to find the latest bors commit, treating it as the "closest upstream commit" so that the change tracker logic can use it to find the diffs. In addition, [skips formatting](https://github.com/rust-lang/rust/commit/e3924544832668a6e239153a90d3be2077fbdce4) if there are no modified files. Fixes #130147
2024-09-11document the new git logic in more detailonur-ozkan-1/+6
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-09-10rustdoc: redesign toolbar and disclosure widgetsMichael Howell-1/+1
This adds labels to the icons and moves them away from the search box. These changes are made together, because they work together, but are based on several complaints: * The [+/-] thing are a Reddit-ism. They don't look like buttons, but look like syntax <https://rust-lang.zulipchat.com/#narrow/stream/266220-t-rustdoc/topic/More.20visual.20difference.20for.20the.20.2B.2F-.20.20Icons>, <https://github.com/rust-lang/rust/issues/59851> (some of these are laundry lists with more suggestions, but they all mention [+/-] looking wrong) * The settings, help, and summary buttons are also too hard to recognize <https://lwn.net/Articles/987070/>, <https://github.com/rust-lang/rust/issues/90310>, <https://github.com/rust-lang/rust/issues/14475#issuecomment-274241997>, <https://internals.rust-lang.org/t/improve-rustdoc-design/12758> ("Not all functionality is self-explanatory, for example the [+] button in the top right corner, the theme picker or the settings button.") The toggle-all and toggle-individual buttons both need done at once, since we want them to look like they go together. This changes them from both being [+/-] to both being arrows. Settings and Help are also migrated, so that the whole group can benefit from being described using actual words. Additionally, the Help button is only shown on SERPs, not all the time. This is done for two major reasons: * Most of what's in there is search-related. The things that aren't are keyboard commands, and the search box tells you about that anyway. Pressing <kbd>?</kbd> will temporarily show the button and its popover. * I'm trading it off by showing the help button, even on mobile. It's useful since you can use the search engine suggestions there. * The three buttons were causing line wrapping on too many desktop layouts.
2024-09-10handle `GitConfig` for `tools/compiletest`onur-ozkan-2/+10
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-09-09Print a helpful message if any tests were skipped for being up-to-dateZalathar-0/+1
2024-09-09Add an explicit ignore message for "up-to-date" testsZalathar-2/+5
When running tests without the `--force-rerun` flag, compiletest will automatically skip any tests that (in its judgement) don't need to be run again since the last time they were run. This patch adds an explicit reason to those skipped tests, which is visible when running with `rust.verbose-tests = true` in `config.toml`.
2024-09-05Rollup merge of #101339 - the8472:ci-randomize-debug, r=Mark-SimulacrumMatthias Krüger-0/+15
enable -Zrandomize-layout in debug CI builds This builds rustc/libs/tools with `-Zrandomize-layout` on *-debug CI runners. Only a handful of tests and asserts break with that enabled, which is promising. One test was fixable, the rest is dealt with by disabling them through new cargo features or compiletest directives. The config.toml flag `rust.randomize-layout` defaults to false, so it has to be explicitly enabled for now.
2024-08-31Add rust.randomize-layout config to build artifacts with -Zrandomize-layoutThe 8472-0/+15
Additionally teach compiletest to ignore tests that rely on deterministic layout. Tests themselves aren't built with randomization but they can still observe slight changes in std or rustc
2024-08-30add borrows to NLL MIR dumpsRémy Rakic-0/+1
explicitly disable `-Zmir-include-spans` in mir-opt tests This will override the NLL default of true, and keep the blessed dumps easier to work with.
2024-08-25strip whitespace for ignored tests reason commentsRémy Rakic-1/+1