about summary refs log tree commit diff
path: root/tests/ui/test-attrs
AgeCommit message (Collapse)AuthorLines
2025-09-27tests: Remove ignore-android directive for fixed issueMartin Nordholts-5/+3
2025-09-26Ignore more failing ui tests for GCC backendGuillaume Gomez-0/+1
2025-08-11Add more docs to templates for attrs with incorrect argumentsEsteban Küber-3/+11
2025-08-08mbe: In error messages, don't assume attributes are always proc macrosJosh Triplett-2/+2
Now that `macro_rules` macros can define attribute rules, make sure error messages account for that.
2025-08-07Rollup merge of #143808 - JonathanBrouwer:should_panic_parser, r=jdonszelmannStuart Cook-21/+72
Port `#[should_panic]` to the new attribute parsing infrastructure Ports `#[should_panic]` to the new attribute parsing infrastructure for https://github.com/rust-lang/rust/issues/131229#issuecomment-2971351163 r? ```@jdonszelmann```
2025-08-06Print thread ID in panic message if thread name is unknownTrevor Gross-12/+12
`panic!` does not print any identifying information for threads that are unnamed. However, in many cases, the thread ID can be determined. This changes the panic message from something like this: thread '<unnamed>' panicked at src/main.rs:3:5: explicit panic To something like this: thread '<unnamed>' (0xff9bf) panicked at src/main.rs:3:5: explicit panic Stack overflow messages are updated as well. This change applies to both named and unnamed threads. The ID printed is the OS integer thread ID rather than the Rust thread ID, which should also be what debuggers print.
2025-08-06Changes to the tests for the `#[should_panic]` portJonathan Brouwer-21/+72
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
2025-06-29Rollup merge of #142214 - Kivooeo:tf9, r=jieyouxuGuillaume Gomez-0/+17
`tests/ui`: A New Order [9/N] Some `tests/ui/` housekeeping, to trim down number of tests directly under `tests/ui/`. Part of rust-lang/rust#133895.
2025-06-28cleaned up some testsKivooeo-0/+17
2025-06-08cleaned up some testsKivooeo-0/+24
2025-04-28Remove backticks from `ShouldPanic::YesWithMessage`'s `TrFailedMsg`Lieselotte-3/+3
2025-04-14Adjust test directivesxizheyin-33/+23
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
2025-04-14Report span of test when should_panic test failedxizheyin-0/+101
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
2025-04-03compiletest: Require `//~` annotations even if `error-pattern` is specifiedVadim Petrochenkov-1/+2
2025-03-14Do not suggest using `-Zmacro-backtrace` for builtin macrosEsteban Küber-3/+0
For macros that are implemented on the compiler, we do *not* mention the `-Zmacro-backtrace` flag. This includes `derive`s and standard macros.
2025-02-21More sophisticated span trimmingMichael Goulet-1/+1
2025-02-14Trim suggestion parts to the subset that is purely additiveMichael Goulet-1/+1
2025-02-14Consider add-prefix replacements tooMichael Goulet-3/+2
2025-02-10Show diff suggestion format on verbose replacementEsteban Küber-29/+45
``` error[E0610]: `{integer}` is a primitive type and therefore doesn't have fields --> $DIR/attempted-access-non-fatal.rs:7:15 | LL | let _ = 2.l; | ^ | help: if intended to be a floating point literal, consider adding a `0` after the period and a `f64` suffix | LL - let _ = 2.l; LL + let _ = 2.0f64; | ```
2025-02-03tests: remove redundant `//@ ignore-{wasm,wasm32,emscripten}`许杰友 Jieyou Xu (Joe)-9/+3
2025-01-23tests: use `needs-threads` instead of `ignore-emscripten`许杰友 Jieyou Xu (Joe)-3/+3
2025-01-23tests: use `needs-subprocess` instead of `ignore-{wasm32,emscripten,sgx}`许杰友 Jieyou Xu (Joe)-8/+9
2025-01-21remove support for the #[start] attributeRalf Jung-7/+0
2025-01-01Try to write the panic message with a single `write_all` callJohn Kåre Alsaker-0/+8
2024-12-27Remove the `-test` suffix from normalize directivesZalathar-10/+10
2024-07-15Update name of Windows abort constant to match platform documentationCharles Celerier-2/+0
2024-07-15Add match arm for Fuchsia status code upon an abort in a testCharles Celerier-3/+3
This change adds ZX_TASK_RETCODE_EXCEPTION_KILL as an expected status code upon an abort in a test on Fuchsia. Tests fixes #127539
2024-07-11Always use a colon in `//@ normalize-*:` headersZalathar-8/+8
2024-07-09Ignore fuchsia tests implicitly relying on a signal upon abortCharles Celerier-3/+5
Both test-panic-abort-nocapture.rs and test-panic-abort.rs assert the stderr output of the test. On Fuchsia, if a test fails an assertion, this output will contain a line noting the process returned the code -1028 (ZX_TASK_RETCODE_EXCEPTION_KILL). But the asserted stderr output lacks this note. Presumably this is because other platforms implement -Cpanic=abort by killing the process instead of returned a status code.
2024-03-11Update test directives for `wasm32-wasip1`Alex Crichton-28/+0
* The WASI targets deal with the `main` symbol a bit differently than native so some `codegen` and `assembly` tests have been ignored. * All `ignore-emscripten` directives have been updated to `ignore-wasm32` to be more clear that all wasm targets are ignored and it's not just Emscripten. * Most `ignore-wasm32-bare` directives are now gone. * Some ignore directives for wasm were switched to `needs-unwind` instead. * Many `ignore-wasm32*` directives are removed as the tests work with WASI as opposed to `wasm32-unknown-unknown`.
2024-03-07Rollup merge of #122109 - alexcrichton:compiletests-needs-threads, ↵Matthias Krüger-2/+2
r=workingjubilee compiletest: Add a `//@ needs-threads` directive This commit is extracted from #122036 and adds a new directive to the `compiletest` test runner, `//@ needs-threads`. This is intended to capture the need that a target must implement threading to execute a specific test, typically one that uses `std::thread`. This is primarily done for WebAssembly targets which currently do not have threads by default. This enables transitioning a lot of `//@ ignore-wasm*`-style ignores into a more self-documenting `//@ needs-threads` directive. Additionally the `wasm32-wasi-preview1-threads` target, for example, does actually have threads, but isn't tested in CI at this time. This change enables running these tests for that target, but not other wasm targets.
2024-03-06compiletest: Add a `//@ needs-threads` directiveAlex Crichton-2/+2
This commit is extracted from #122036 and adds a new directive to the `compiletest` test runner, `//@ needs-threads`. This is intended to capture the need that a target must implement threading to execute a specific test, typically one that uses `std::thread`. This is primarily done for WebAssembly targets which currently do not have threads by default. This enables transitioning a lot of `//@ ignore-wasm*`-style ignores into a more self-documenting `//@ needs-threads` directive. Additionally the `wasm32-wasi-preview1-threads` target, for example, does actually have threads, but isn't tested in CI at this time. This change enables running these tests for that target, but not other wasm targets.
2024-03-04libtest: Print the names of failed tests eagerlyjyn-0/+156
Previously, libtest would wait until all tests finished running to print the progress, which made it annoying to run many tests at once (since you don't know which have failed). Change it to print the names as soon as they fail. This also adds a test for the terse output; previously it was untested.
2024-02-16[AUTO-GENERATED] Migrate ui tests from `//` to `//@` directives许杰友 Jieyou Xu (Joe)-148/+148
2024-02-01Ignore test-panic-abort tests on AndroidTyler Mandry-3/+5
Until #120567 is fixed.
2023-11-24Show number in error message even for one errorNilstrieb-5/+5
Co-authored-by: Adrian <adrian.iosdev@gmail.com>
2023-09-01Auto merge of #113126 - Bryanskiy:delete_old, r=petrochenkovbors-1/+1
Replace old private-in-public diagnostic with type privacy lints Next part of RFC https://github.com/rust-lang/rust/issues/48054. r? `@petrochenkov`
2023-08-15Cleaner assert_eq! & assert_ne! panic messagesYuri Astrakhan-9/+9
Modify panic message for `assert_eq!`, `assert_ne!`, the currently unstable `assert_matches!`, as well as the corresponding `debug_assert_*` macros. ```rust assert_eq!(1 + 1, 3); assert_eq!(1 + 1, 3, "my custom message value={}!", 42); ``` ```plain thread 'main' panicked at $DIR/main.rs:6:5: assertion failed: `(left == right)` left: `2`, right: `3` ``` ```plain thread 'main' panicked at $DIR/main.rs:6:5: assertion failed: `(left == right)` left: `2`, right: `3`: my custom message value=42! ``` ```plain thread 'main' panicked at $DIR/main.rs:6:5: assertion `left == right` failed left: 2 right: 3 ``` ```plain thread 'main' panicked at $DIR/main.rs:6:5: assertion `left == right` failed: my custom message value=42! left: 2 right: 3 ``` This PR is a simpler subset of the #111030, but it does NOT stringify the original left and right source code assert expressions, thus should be faster to compile.
2023-08-02Replace old private-in-public diagnostic with type privacy lintsBryanskiy-1/+1
2023-07-29Change default panic handler message format.Mara Bos-8/+13
2023-07-01Auto merge of #111992 - ferrocene:pa-panic-abort-tests-bench, r=m-ou-sebors-4/+14
Test benchmarks with `-Z panic-abort-tests` During test execution, when a `#[bench]` benchmark is encountered it's executed once to check whether it works. Unfortunately that was not compatible with `-Z panic-abort-tests`: the feature works by spawning a subprocess for each test, which prevents the use of dynamic tests as we cannot pass closures to child processes, and before this PR the conversion from benchmark to test was done by turning benchmarks into dynamic tests whose closures execute the benchmark once. The approach this PR took was to add two new kinds of `TestFn`s: `StaticBenchAsTestFn` and `DynBenchAsTestFn` (:warning: **this is a breaking change** :warning:). With that change, a `StaticBenchFn` can be converted into a `StaticBenchAsTestFn` without creating dynamic tests, and making it possible to test `#[bench]` functions with `-Z panic-abort-tests`. The subprocess test runner also had to be updated to perform the conversion from benchmark to test when appropriate. Along with the bug fix, in the first commit I refactored how tests are executed: rather than executing the test function in multiple places across `libtest`, there is now a private `TestFn::into_runnable()` method, which returns either a `RunnableTest` or `RunnableBench`, on which you can call the `run()` method. This simplified the rest of the changes in the PR. This PR is best reviewed commit-by-commit. Fixes https://github.com/rust-lang/rust/issues/73509
2023-06-23Rollup merge of #112616 - ferrocene:pa-more-test-suite-fixes, r=NilstriebMatthias Krüger-2/+2
Improve tests on targets without unwinding This PR makes more miscellaneous changes to tests, to make it work on targets without unwinding support.
2023-06-21remove needs-unwind attr for test with -Zpanic-abort-testsPietro Albini-1/+0
2023-06-14mark relevant tests as requiring unwindingPietro Albini-0/+1
2023-06-14ensure test harness test works on panic=abort targetsPietro Albini-1/+1
2023-06-07Add test for test function signature verification.Lukas Markeffsky-0/+70
2023-05-26Revert "Adjusting test to needs-unwind, with linking issue"Pietro Albini-1/+1
This reverts commit 205006660a4bd36b7cdf4b0938cfd50a4e785ca7.
2023-05-26add tests on running benchmarks with -Z panic-abort-testsPietro Albini-3/+13
2023-05-24libtest: Improve error when missing `-Zunstable-options`jyn-1/+1
"only accepted on the nightly compiler" is misleading when this *is* nightly.
2023-05-08Move testsCaio-0/+66