about summary refs log tree commit diff
path: root/tests/ui/test-attrs
AgeCommit message (Collapse)AuthorLines
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
2023-05-02Add needs-unwind annotations to tests that need stack unwindingbjorn3-0/+1
2023-04-28bless line changes in tests-listing-format-json.run.stdoutJosh Stone-3/+3
2023-04-21update tests for the test harness's json formattingPietro Albini-0/+1
2023-04-07fix: ensure bad `#[test]` invocs retain correct ASTEzra Shaw-32/+57
2023-03-20Rollup merge of #109301 - Ezrashaw:fix-ctf-ice, r=NilstriebMatthias Krüger-0/+25
fix: fix ICE in `custom-test-frameworks` feature Fixes #107454 Simple fix to emit error instead of ICEing. At some point, all the code in `tests.rs` should be refactored, there is a bit of duplication (this PR's code is repeated five times over lol). r? `@Nilstrieb` (active on the linked issue?)
2023-03-19fix: fix ICE in `custom-test-frameworks` featureEzra Shaw-0/+25
2023-03-15Implementing "<test_binary> --list --format json" #107307 #49359Partha P. Das-0/+88
2023-01-17Fix use suggestion spanMichael Goulet-1/+1
2023-01-11Move /src/test to /testsAlbert Larsan-0/+1066