mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
Add normalization for thread IDs in panic messages
So we don't need to add normalization to every test that includes a panic message, add a global normalization to compiletest.
This commit is contained in:
@@ -2567,6 +2567,11 @@ fn normalize_output(&self, output: &str, custom_rules: &[(String, String)]) -> S
|
||||
})
|
||||
.into_owned();
|
||||
|
||||
// Normalize thread IDs in panic messages
|
||||
normalized = static_regex!(r"thread '(?P<name>.*?)' \((rtid )?\d+\) panicked")
|
||||
.replace_all(&normalized, "thread '$name' ($$TID) panicked")
|
||||
.into_owned();
|
||||
|
||||
normalized = normalized.replace("\t", "\\t"); // makes tabs visible
|
||||
|
||||
// Remove test annotations like `//~ ERROR text` from the output,
|
||||
|
||||
@@ -248,7 +248,8 @@ fn $name() -> &'static [(Match, &'static [u8])] {
|
||||
// erase alloc ids
|
||||
"alloc[0-9]+" => "ALLOC",
|
||||
// erase thread ids
|
||||
r"unnamed-[0-9]+" => "unnamed-ID",
|
||||
r"unnamed-[0-9]+" => "unnamed-ID",
|
||||
r"thread '(?P<name>.*?)' \(\d+\) panicked" => "thread '$name' ($$TID) panicked",
|
||||
// erase borrow tags
|
||||
"<[0-9]+>" => "<TAG>",
|
||||
"<[0-9]+=" => "<TAG=",
|
||||
|
||||
Reference in New Issue
Block a user