Skip to content

Commit e86c68a

Browse files
committed
Auto merge of #3085 - RalfJung:test-norm, r=RalfJung
fix normalization in backtrace-api tests also remove a normalization rule that doesn't seem to apply
2 parents 32c0afb + ee30aaf commit e86c68a

File tree

5 files changed

+33
-5
lines changed

5 files changed

+33
-5
lines changed

src/tools/miri/tests/compiletest.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,6 @@ regexes! {
179179
r" +at (.*\.rs)" => " at $1",
180180
// erase generics in backtraces
181181
"([0-9]+: .*)::<.*>" => "$1",
182-
// erase addresses in backtraces
183-
"([0-9]+: ) +0x[0-9a-f]+ - (.*)" => "$1$2",
184182
// erase long hexadecimals
185183
r"0x[0-9a-fA-F]+[0-9a-fA-F]{2,2}" => "$$HEX",
186184
// erase specific alignments
@@ -192,7 +190,7 @@ regexes! {
192190
// Windows file paths
193191
r"\\" => "/",
194192
// erase Rust stdlib path
195-
"[^ `]*/(rust[^/]*|checkout)/library/" => "RUSTLIB/",
193+
"[^ \n`]*/(rust[^/]*|checkout)/library/" => "RUSTLIB/",
196194
// erase platform file paths
197195
"sys/[a-z]+/" => "sys/PLATFORM/",
198196
// erase paths into the crate registry

src/tools/miri/tests/pass/backtrace/backtrace-api-v0.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ fn main() {
4141
eprintln!("{}", out);
4242
// Print the 'main' frame (and everything before it) to stdout, skipping
4343
// the printing of internal (and possibly fragile) libstd frames.
44+
// Stdout is less normalized so we see more, but it also means we can print less
45+
// as platform differences would lead to test suite failures.
4446
if !seen_main {
4547
println!("{}", out);
4648
seen_main = name == "main";

src/tools/miri/tests/pass/backtrace/backtrace-api-v0.stderr

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,17 @@ $DIR/backtrace-api-v0.rs:LL:CC (func_d)
22
$DIR/backtrace-api-v0.rs:LL:CC (func_c)
33
$DIR/backtrace-api-v0.rs:LL:CC (func_b)
44
$DIR/backtrace-api-v0.rs:LL:CC (func_a)
5-
$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)
5+
$DIR/backtrace-api-v0.rs:LL:CC (main)
6+
RUSTLIB/core/src/ops/function.rs:LL:CC (<fn() as std::ops::FnOnce<()>>::call_once - shim(fn()))
7+
RUSTLIB/std/src/sys_common/backtrace.rs:LL:CC (std::sys_common::backtrace::__rust_begin_short_backtrace)
8+
RUSTLIB/std/src/rt.rs:LL:CC (std::rt::lang_start::{closure#0})
9+
RUSTLIB/core/src/ops/function.rs:LL:CC (std::ops::function::impls::call_once)
10+
RUSTLIB/std/src/panicking.rs:LL:CC (std::panicking::r#try::do_call)
11+
RUSTLIB/std/src/panicking.rs:LL:CC (std::panicking::r#try)
12+
RUSTLIB/std/src/panic.rs:LL:CC (std::panic::catch_unwind)
13+
RUSTLIB/std/src/rt.rs:LL:CC (std::rt::lang_start_internal::{closure#2})
14+
RUSTLIB/std/src/panicking.rs:LL:CC (std::panicking::r#try::do_call)
15+
RUSTLIB/std/src/panicking.rs:LL:CC (std::panicking::r#try)
16+
RUSTLIB/std/src/panic.rs:LL:CC (std::panic::catch_unwind)
17+
RUSTLIB/std/src/rt.rs:LL:CC (std::rt::lang_start_internal)
18+
RUSTLIB/std/src/rt.rs:LL:CC (std::rt::lang_start)

src/tools/miri/tests/pass/backtrace/backtrace-api-v1.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ fn main() {
5454
eprintln!("{}", out);
5555
// Print the 'main' frame (and everything before it) to stdout, skipping
5656
// the printing of internal (and possibly fragile) libstd frames.
57+
// Stdout is less normalized so we see more, but it also means we can print less
58+
// as platform differences would lead to test suite failures.
5759
if !seen_main {
5860
println!("{}", out);
5961
seen_main = name == "main";

src/tools/miri/tests/pass/backtrace/backtrace-api-v1.stderr

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,17 @@ $DIR/backtrace-api-v1.rs:LL:CC (func_d)
22
$DIR/backtrace-api-v1.rs:LL:CC (func_c)
33
$DIR/backtrace-api-v1.rs:LL:CC (func_b)
44
$DIR/backtrace-api-v1.rs:LL:CC (func_a)
5-
$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)
5+
$DIR/backtrace-api-v1.rs:LL:CC (main)
6+
RUSTLIB/core/src/ops/function.rs:LL:CC (<fn() as std::ops::FnOnce<()>>::call_once - shim(fn()))
7+
RUSTLIB/std/src/sys_common/backtrace.rs:LL:CC (std::sys_common::backtrace::__rust_begin_short_backtrace)
8+
RUSTLIB/std/src/rt.rs:LL:CC (std::rt::lang_start::{closure#0})
9+
RUSTLIB/core/src/ops/function.rs:LL:CC (std::ops::function::impls::call_once)
10+
RUSTLIB/std/src/panicking.rs:LL:CC (std::panicking::r#try::do_call)
11+
RUSTLIB/std/src/panicking.rs:LL:CC (std::panicking::r#try)
12+
RUSTLIB/std/src/panic.rs:LL:CC (std::panic::catch_unwind)
13+
RUSTLIB/std/src/rt.rs:LL:CC (std::rt::lang_start_internal::{closure#2})
14+
RUSTLIB/std/src/panicking.rs:LL:CC (std::panicking::r#try::do_call)
15+
RUSTLIB/std/src/panicking.rs:LL:CC (std::panicking::r#try)
16+
RUSTLIB/std/src/panic.rs:LL:CC (std::panic::catch_unwind)
17+
RUSTLIB/std/src/rt.rs:LL:CC (std::rt::lang_start_internal)
18+
RUSTLIB/std/src/rt.rs:LL:CC (std::rt::lang_start)

0 commit comments

Comments
 (0)