about summary refs log tree commit diff
path: root/src/tools/compiletest
AgeCommit message (Collapse)AuthorLines
2025-07-30Rollup merge of #144662 - Zalathar:directive-names, r=fmeaseStuart Cook-290/+293
compiletest: Move directive names back into a separate file This list no longer needs to be included in multiple crates, but having the list in its own file makes it easier to find and update when necessary. As discussed at https://github.com/rust-lang/rust/pull/143850#issuecomment-3130307023.
2025-07-30compiletest: Move directive names back into a separate fileZalathar-290/+293
This list no longer needs to be included in multiple crates, but having it in its own file makes it easier to find and update when necessary.
2025-07-29Verify llvm-needs-components are not empty and match the --target valueDaniel Paoliello-52/+181
2025-07-27Rollup merge of #144454 - folkertdev:uefi-tests, r=jieyouxuMatthias Krüger-0/+1
move uefi test to run-make Turn the `uefi` test into a more standard `run-make` test, and execute it using the `test-various` CI job like before. This is just a straightforward translation of the python code, but using `run-make` to supply the target (hence the 3 separate calls in the docker file). r? ```@jieyouxu``` cc ```@nicholasbishop``` try-job: test-various
2025-07-26move uefi test to run-makeFolkert de Vries-0/+1
2025-07-26Auto merge of #144490 - tgross35:rollup-ps0utme, r=tgross35bors-0/+1
Rollup of 9 pull requests Successful merges: - rust-lang/rust#140871 (Don't lint against named labels in `naked_asm!`) - rust-lang/rust#141663 (rustdoc: add ways of collapsing all impl blocks) - rust-lang/rust#143272 (Upgrade the `fortanix-sgx-abi` dependency) - rust-lang/rust#143585 (`loop_match`: suggest extracting to a `const` item) - rust-lang/rust#143698 (Fix unused_parens false positive) - rust-lang/rust#143859 (Guarantee 8 bytes of alignment in Thread::into_raw) - rust-lang/rust#144160 (tests: debuginfo: Work around or disable broken tests on powerpc) - rust-lang/rust#144412 (Small cleanup: Use LocalKey<Cell> methods more) - rust-lang/rust#144431 (Disable has_reliable_f128_math on musl targets) r? `@ghost` `@rustbot` modify labels: rollup
2025-07-26Rollup merge of #144160 - Gelbpunkt:debuginfo-tests-ppc, r=oli-obkTrevor Gross-0/+1
tests: debuginfo: Work around or disable broken tests on powerpc f16 support for PowerPC has issues in LLVM, therefore we need a small workaround to prevent LLVM from emitting symbols that don't exist for PowerPC yet. It also appears that rust-lang/rust#128973 applies to PowerPC targets as well, though I've only tested 64-bit Linux targets.
2025-07-23Fix `compiletest` bad handling of `ignore-backends`Guillaume Gomez-0/+5
2025-07-22Only run `tests/assembly-*` and `tests/codegen-*` tests if they match the ↵Guillaume Gomez-3/+20
current codegen backend
2025-07-20Add new `needs-backends` tests annotationsGuillaume Gomez-0/+25
2025-07-20Add new `ignore-backends` tests annotationsGuillaume Gomez-2/+75
2025-07-20tests: debuginfo: Work around or disable broken tests on powerpcJens Reidel-0/+1
f16 support for PowerPC has issues in LLVM, therefore we need a small workaround to prevent LLVM from emitting symbols that don't exist for PowerPC yet. It also appears that unused by-value non-immedate issue with gdb applies to PowerPC targets as well, though I've only tested 64-bit Linux targets. Signed-off-by: Jens Reidel <adrian@travitia.xyz>
2025-07-19tests: Require `run-fail` ui tests to have an exit code (`SIGABRT` not ok)Martin Nordholts-12/+88
And introduce two new directives for ui tests: * `run-crash` * `run-fail-or-crash` Normally a `run-fail` ui test like tests that panic shall not be terminated by a signal like `SIGABRT`. So begin having that as a hard requirement. Some of our current tests do terminate by a signal/crash however. Introduce and use `run-crash` for those tests. Note that Windows crashes are not handled by signals but by certain high bits set on the process exit code. Example exit code for crash on Windows: `0xc000001d`. Because of this, we define "crash" on all platforms as "not exit with success and not exit with a regular failure code in the range 1..=127". Some tests behave differently on different targets: * Targets without unwind support will abort (crash) instead of exit with failure code 101 after panicking. As a special case, allow crashes for `run-fail` tests for such targets. * Different sanitizer implementations handle detected memory problems differently. Some abort (crash) the process while others exit with failure code 1. Introduce and use `run-fail-or-crash` for such tests.
2025-07-15Rollup merge of #142301 - Gelbpunkt:duplicated-path-in-error-musl, ↵Samuel Tardieu-0/+1
r=workingjubilee,fmease,jieyouxu tests: Fix duplicated-path-in-error fail with musl musl's dlopen returns a different error than glibc, which contains the name of the file. This would cause the test to fail, since the filename would appear twice in the output (once in the error from rustc, once in the error message from musl). Split the expected test outputs for the different libc implementations. Fixes rust-lang/rust#128474
2025-07-14tests: Fix duplicated-path-in-error fail with muslJens Reidel-0/+1
musl's dlopen returns a different error than glibc, which contains the name of the file. This would cause the test to fail, since the filename would appear twice in the output (once in the error from rustc, once in the error message from musl). Split the expected test outputs for the different libc implementations. Signed-off-by: Jens Reidel <adrian@travitia.xyz>
2025-07-14Rollup merge of #143870 - jieyouxu:compiletest-maintenance-6, r=KobzolSamuel Tardieu-20/+44
[COMPILETEST-UNTANGLE 6/N] Use `TestSuite` enum instead of stringly-typed test suites This is part of a patch series to untangle `compiletest` to hopefully nudge it towards being more maintainable. This PR should contain no functional changes.
2025-07-14Use `TestSuite` enum instead of stringly-typed test suitesJieyou Xu-20/+44
2025-07-13Compiletest: Simplify {Html,Json}DocCk directive handlingLeón Orell Valerian Liehr-289/+275
2025-07-13Rollup merge of #143823 - jieyouxu:compiletest-maintenance-5, r=KobzolLeón Orell Valerian Liehr-163/+252
[COMPILETEST-UNTANGLE 5/N] Test mode adjustments and other assorted cleanups This is part of a patch series to untangle `compiletest` to hopefully nudge it towards being more maintainable. This PR should contain no functional changes modulo the removed debugger version warning. - Commit 1: Removes a very outdated debugger version warning. - Commit 2: Moves `string_enum` out of `common` into `util` module. - Commit 3: Remove `#[derive(Default)` for `Mode` and `Config`. It is very important for correctness that we *don't* `#[derive(Default)]`, because there are no sensible defaults, so stop pretending there is. - Commit 4: Rename `Mode` -> `TestMode`, because I would like to introduce a `TestSuite` enum to stop using stringly-typed test suite names where test mode names can be the same as test suite names, and we also have a bunch of other "modes" in compiletest. Make this as unambiguous as possible. A corollary is that now it's more natural to reference via intra-doc links as ``[`TestMode`]``. - Commit 5: Ditto on `TestSuite`, stop glob-reexporting `TestMode::*` variants, and always use `EnumName::VariantName` form. - Commit 6: Apparently, `src/tools/rustdoc-gui-test/` depends on `compiletest` for `//@ {compile,run}-paths` directive parsing and extraction, which involves creating a dummy `compiletest` config (hence the existence of the default impls removed in Commit 3). Make this a specific associated function with a FIXME pointing to rust-lang/rust#143827 as I think this setup is quite questionable. Commits {4, 5} are also intended to help improve the self-consistency in nomenclature used within compiletest. Best reviewed commit-by-commit.
2025-07-12Make rustdoc-gui-test dummy compiletest config purpose explicitJieyou Xu-0/+101
2025-07-12Do not glob-reexport `TestMode` variantsJieyou Xu-53/+65
I would like to introduce `TestSuite` over stringly-typed test suite names, and some test suite names are the same as test modes, which can make this very confusing.
2025-07-12Rename `Mode` to `TestMode`Jieyou Xu-44/+44
It is *critical* that we maintain clear nomenclature in `compiletest`. We have many types of "modes" in `compiletest` -- pass modes, coverage modes, compare modes, you name it. `Mode` is also a *super* general term. Rename it to `TestMode` to leave no room for such ambiguity. As a follow-up, I also intend to introduce an enum for `TestSuite`, then rid of all usage of glob re-exported `TestMode::*` enum variants -- many test suites share the same name as the test mode.
2025-07-12Do not allow defaults for `Mode` and `Config`Jieyou Xu-7/+1
They do not have sensible defaults, and it is crucial that we get them right.
2025-07-12Move `string_enum` to `util` moduleJieyou Xu-49/+42
2025-07-12Remove outdated debugger version warningJieyou Xu-11/+0
2025-07-11Disambiguate between rustc vs std having debug assertionsJieyou Xu-0/+13
Additionally, `NO_DEBUG_ASSERTIONS` is set by CI that threads through to the `./configure` script, which is somewhat fragile and "spooky action at a distance". Instead, use env vars controlled by compiletest, whose debug assertion info comes from bootstrap.
2025-07-10Remove uncessary parens in closure body with unused lintyukang-0/+6
2025-07-06Rollup merge of #143504 - RalfJung:compiletest-err, r=jieyouxuMatthias Krüger-1/+2
compiletest: print slightly more information on fs::write failure See [#t-infra > compiletest: panic in dump_output_file: No such file or dire @ 💬](https://rust-lang.zulipchat.com/#narrow/channel/242791-t-infra/topic/compiletest.3A.20panic.20in.20dump_output_file.3A.20No.20such.20file.20or.20dire/near/527294714)
2025-07-05compiletest: print slightly more information on fs::write failureRalf Jung-1/+2
2025-07-05Improve compiletest config documentationJieyou Xu-93/+353
Including a bunch of FIXMEs.
2025-07-02Rename {`HeadersCache`, `iter_header`} -> {`DirectivesCache`, ↵Jieyou Xu-14/+14
`iter_directives`} for self-consistency
2025-07-02Update compiletest to use "directive" terminology consistentlyJieyou Xu-24/+23
2025-07-02Rename `header` -> `directives`Jieyou Xu-11/+11
compiletest has confusingly two terminology to refer to the same concept -- "headers" and "directives". To make this more self-consistent and less confusing, stick with "directives" only. This commit **intentionally** tries to be limited to move-only (modulo some key usage reference renames) to help git history.
2025-07-01Make some compiletest errors/warnings/help more visually obviousJieyou Xu-38/+84
2025-06-30Move `RUST_TEST_NOCAPTURE` warning to early config checkJieyou Xu-6/+7
2025-06-30Move compiletest `main.rs` to `src/bin/`Jieyou Xu-0/+4
To make it obvious `compiletest`-the-tool has two components: 1. The core compiletest library, and 2. The tool binary, which will be executed by bootstrap.
2025-06-30Move some early config checks to the compiletest libJieyou Xu-14/+17
2025-06-26Fix some fixmes that were waiting for let chainsYotam Ofek-3/+3
2025-06-23compiletest: Improve diagnostics for line annotation mismatchesVadim Petrochenkov-76/+159
2025-06-22forward the bootstrap `runner` to `run-make`Folkert de Vries-0/+4
The runner was already forwarded to `compiletest`, this just passes it on to `run-make` and uses it in the `run` functions.
2025-06-18Auto merge of #142689 - Urgau:rollup-4ho6835, r=Urgaubors-0/+6
Rollup of 6 pull requests Successful merges: - rust-lang/rust#135656 (Add `-Z hint-mostly-unused` to tell rustc that most of a crate will go unused) - rust-lang/rust#138237 (Get rid of `EscapeDebugInner`.) - rust-lang/rust#141614 (lint direct use of rustc_type_ir ) - rust-lang/rust#142123 (Implement initial support for timing sections (`--json=timings`)) - rust-lang/rust#142377 (Try unremapping compiler sources) - rust-lang/rust#142674 (remove duplicate crash test) r? `@ghost` `@rustbot` modify labels: rollup
2025-06-18Rollup merge of #142377 - Urgau:unremap-rustc-dev, r=jieyouxuUrgau-0/+6
Try unremapping compiler sources See [#t-compiler/help > Span pointing to wrong file location (`rustc-dev` component)](https://rust-lang.zulipchat.com/#narrow/channel/182449-t-compiler.2Fhelp/topic/Span.20pointing.20to.20wrong.20file.20location.20.28.60rustc-dev.60.20component.29/with/521087083). This PR is a follow-up to rust-lang/rust#141751 regarding the compiler side. Specifically we now take into account the `CFG_VIRTUAL_RUSTC_DEV_SOURCE_BASE_DIR` env from rust-lang/rust#141751 when trying to unremap sources from `$sysroot/lib/rustlib/rustc-src/rust` (the `rustc-dev` component install directory). Best reviewed commit by commit. cc ``@samueltardieu`` r? ``@jieyouxu``
2025-06-18Rollup merge of #142672 - Kobzol:bootstrap-tool-clarification, r=jieyouxuJakub Beránek-3/+3
Clarify bootstrap tools description The existence of `stage0-bootstrap-tools` suggests the possiblity of `stage1/N-bootstrap-tools`, but that's not really a thing. Also it doesn't fit the new bootstrap model, where `stageN` essentially means that it was built with a `stageN-1` compiler (except for std). r? ``@jieyouxu``
2025-06-18Fix compiletest and rustc-dev-guideJakub Beránek-3/+3
2025-06-17apply clippy::or_fun_callklensy-4/+5
2025-06-15Un-remap `rustc-dev` component pathsUrgau-0/+6
2025-06-13compiletest: Clarify that `--no-capture` is needed with `--verbose`Martin Nordholts-0/+1
Confusingly, this does not make compile test print what command is used to run a ui test: ./x test tests/ui/panics/abort-on-panic.rs --verbose It is also necessary to pass `--no-capture`, like this: ./x test tests/ui/panics/abort-on-panic.rs --verbose --no-capture Now you will see prints like this: executing cd "/rust/build/x86_64-unknown-linux-gnu/test/ui/panics/abort-on-panic.next" && \ RUSTC="/rust/build/x86_64-unknown-linux-gnu/stage1/bin/rustc" \ RUST_TEST_THREADS="32" \ "/rust/build/x86_64-unknown-linux-gnu/test/ui/panics/abort-on-panic.next/a" Add a hint in the code for this that would have helped me figure this out.
2025-06-10Implement `//@ needs-target-std` directive in compiletestJieyou Xu-0/+17
To support tests to condition their (potentially cross-compile) execution based on whether the target supports std.
2025-06-06Add new Tier-3 targets: `loongarch32-unknown-none*`WANG Rui-0/+3
MCP: https://github.com/rust-lang/compiler-team/issues/865
2025-05-17compiler & tools: bump windows crate to dedupe versionsklensy-1/+1