fix normalization in backtrace-api tests

also remove a normalization rule that doesn't seem to apply
This commit is contained in:
Ralf Jung 2023-09-25 13:38:26 +02:00
parent b4dc4f3c1c
commit ee30aaf7ea
5 changed files with 33 additions and 5 deletions

View File

@ -179,8 +179,6 @@ regexes! {
r" +at (.*\.rs)" => " at $1",
// erase generics in backtraces
"([0-9]+: .*)::<.*>" => "$1",
// erase addresses in backtraces
"([0-9]+: ) +0x[0-9a-f]+ - (.*)" => "$1$2",
// erase long hexadecimals
r"0x[0-9a-fA-F]+[0-9a-fA-F]{2,2}" => "$$HEX",
// erase specific alignments
@ -192,7 +190,7 @@ regexes! {
// Windows file paths
r"\\" => "/",
// erase Rust stdlib path
"[^ `]*/(rust[^/]*|checkout)/library/" => "RUSTLIB/",
"[^ \n`]*/(rust[^/]*|checkout)/library/" => "RUSTLIB/",
// erase platform file paths
"sys/[a-z]+/" => "sys/PLATFORM/",
// erase paths into the crate registry

View File

@ -41,6 +41,8 @@ fn main() {
eprintln!("{}", out);
// Print the 'main' frame (and everything before it) to stdout, skipping
// the printing of internal (and possibly fragile) libstd frames.
// Stdout is less normalized so we see more, but it also means we can print less
// as platform differences would lead to test suite failures.
if !seen_main {
println!("{}", out);
seen_main = name == "main";

View File

@ -2,4 +2,17 @@ $DIR/backtrace-api-v0.rs:LL:CC (func_d)
$DIR/backtrace-api-v0.rs:LL:CC (func_c)
$DIR/backtrace-api-v0.rs:LL:CC (func_b)
$DIR/backtrace-api-v0.rs:LL:CC (func_a)
$DIR/backtrace-api-v0.rs:LL:CC RUSTLIB/core/src/ops/function.rs:LL:CC (<fn() as std::ops::FnOnce<()>>::call_once - RUSTLIB/std/src/sys_common/backtrace.rs:LL:CC (std::sys_common::backtrace::__rust_begin_short_backtrace)
$DIR/backtrace-api-v0.rs:LL:CC (main)
RUSTLIB/core/src/ops/function.rs:LL:CC (<fn() as std::ops::FnOnce<()>>::call_once - shim(fn()))
RUSTLIB/std/src/sys_common/backtrace.rs:LL:CC (std::sys_common::backtrace::__rust_begin_short_backtrace)
RUSTLIB/std/src/rt.rs:LL:CC (std::rt::lang_start::{closure#0})
RUSTLIB/core/src/ops/function.rs:LL:CC (std::ops::function::impls::call_once)
RUSTLIB/std/src/panicking.rs:LL:CC (std::panicking::r#try::do_call)
RUSTLIB/std/src/panicking.rs:LL:CC (std::panicking::r#try)
RUSTLIB/std/src/panic.rs:LL:CC (std::panic::catch_unwind)
RUSTLIB/std/src/rt.rs:LL:CC (std::rt::lang_start_internal::{closure#2})
RUSTLIB/std/src/panicking.rs:LL:CC (std::panicking::r#try::do_call)
RUSTLIB/std/src/panicking.rs:LL:CC (std::panicking::r#try)
RUSTLIB/std/src/panic.rs:LL:CC (std::panic::catch_unwind)
RUSTLIB/std/src/rt.rs:LL:CC (std::rt::lang_start_internal)
RUSTLIB/std/src/rt.rs:LL:CC (std::rt::lang_start)

View File

@ -54,6 +54,8 @@ fn main() {
eprintln!("{}", out);
// Print the 'main' frame (and everything before it) to stdout, skipping
// the printing of internal (and possibly fragile) libstd frames.
// Stdout is less normalized so we see more, but it also means we can print less
// as platform differences would lead to test suite failures.
if !seen_main {
println!("{}", out);
seen_main = name == "main";

View File

@ -2,4 +2,17 @@ $DIR/backtrace-api-v1.rs:LL:CC (func_d)
$DIR/backtrace-api-v1.rs:LL:CC (func_c)
$DIR/backtrace-api-v1.rs:LL:CC (func_b)
$DIR/backtrace-api-v1.rs:LL:CC (func_a)
$DIR/backtrace-api-v1.rs:LL:CC RUSTLIB/core/src/ops/function.rs:LL:CC (<fn() as std::ops::FnOnce<()>>::call_once - RUSTLIB/std/src/sys_common/backtrace.rs:LL:CC (std::sys_common::backtrace::__rust_begin_short_backtrace)
$DIR/backtrace-api-v1.rs:LL:CC (main)
RUSTLIB/core/src/ops/function.rs:LL:CC (<fn() as std::ops::FnOnce<()>>::call_once - shim(fn()))
RUSTLIB/std/src/sys_common/backtrace.rs:LL:CC (std::sys_common::backtrace::__rust_begin_short_backtrace)
RUSTLIB/std/src/rt.rs:LL:CC (std::rt::lang_start::{closure#0})
RUSTLIB/core/src/ops/function.rs:LL:CC (std::ops::function::impls::call_once)
RUSTLIB/std/src/panicking.rs:LL:CC (std::panicking::r#try::do_call)
RUSTLIB/std/src/panicking.rs:LL:CC (std::panicking::r#try)
RUSTLIB/std/src/panic.rs:LL:CC (std::panic::catch_unwind)
RUSTLIB/std/src/rt.rs:LL:CC (std::rt::lang_start_internal::{closure#2})
RUSTLIB/std/src/panicking.rs:LL:CC (std::panicking::r#try::do_call)
RUSTLIB/std/src/panicking.rs:LL:CC (std::panicking::r#try)
RUSTLIB/std/src/panic.rs:LL:CC (std::panic::catch_unwind)
RUSTLIB/std/src/rt.rs:LL:CC (std::rt::lang_start_internal)
RUSTLIB/std/src/rt.rs:LL:CC (std::rt::lang_start)