summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/integration.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 03:59:35 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 03:59:35 +0000
commitd1b2d29528b7794b41e66fc2136e395a02f8529b (patch)
treea4a17504b260206dec3cf55b2dca82929a348ac2 /src/tools/clippy/tests/integration.rs
parentReleasing progress-linux version 1.72.1+dfsg1-1~progress7.99u1. (diff)
downloadrustc-d1b2d29528b7794b41e66fc2136e395a02f8529b.tar.xz
rustc-d1b2d29528b7794b41e66fc2136e395a02f8529b.zip
Merging upstream version 1.73.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/tools/clippy/tests/integration.rs')
-rw-r--r--src/tools/clippy/tests/integration.rs24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/tools/clippy/tests/integration.rs b/src/tools/clippy/tests/integration.rs
index a771d8b87..031982edb 100644
--- a/src/tools/clippy/tests/integration.rs
+++ b/src/tools/clippy/tests/integration.rs
@@ -65,6 +65,30 @@ fn integration_test() {
.expect("unable to run clippy");
let stderr = String::from_utf8_lossy(&output.stderr);
+
+ // debug:
+ eprintln!("{stderr}");
+
+ // this is an internal test to make sure we would correctly panic on a delay_span_bug
+ if repo_name == "matthiaskrgr/clippy_ci_panic_test" {
+ // we need to kind of switch around our logic here:
+ // if we find a panic, everything is fine, if we don't panic, SOMETHING is broken about our testing
+
+ // the repo basically just contains a delay_span_bug that forces rustc/clippy to panic:
+ /*
+ #![feature(rustc_attrs)]
+ #[rustc_error(delay_span_bug_from_inside_query)]
+ fn main() {}
+ */
+
+ if stderr.find("error: internal compiler error").is_some() {
+ eprintln!("we saw that we intentionally panicked, yay");
+ return;
+ }
+
+ panic!("panic caused by delay_span_bug was NOT detected! Something is broken!");
+ }
+
if let Some(backtrace_start) = stderr.find("error: internal compiler error") {
static BACKTRACE_END_MSG: &str = "end of query stack";
let backtrace_end = stderr[backtrace_start..]