about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2023-09-25 13:38:26 +0200
committerRalf Jung <post@ralfj.de>2023-09-25 15:02:04 +0200
commitee30aaf7ea5ac3db40cd6da4172e214c5dbd9ef0 (patch)
tree4b7cd086ba44352e387a061bed52039b1a21fed9 /src
parentb4dc4f3c1c53295476635c153e0055ab0166c2a0 (diff)
downloadrust-ee30aaf7ea5ac3db40cd6da4172e214c5dbd9ef0.tar.gz
rust-ee30aaf7ea5ac3db40cd6da4172e214c5dbd9ef0.zip
fix normalization in backtrace-api tests
also remove a normalization rule that doesn't seem to apply
Diffstat (limited to 'src')
-rw-r--r--src/tools/miri/tests/compiletest.rs4
-rw-r--r--src/tools/miri/tests/pass/backtrace/backtrace-api-v0.rs2
-rw-r--r--src/tools/miri/tests/pass/backtrace/backtrace-api-v0.stderr15
-rw-r--r--src/tools/miri/tests/pass/backtrace/backtrace-api-v1.rs2
-rw-r--r--src/tools/miri/tests/pass/backtrace/backtrace-api-v1.stderr15
5 files changed, 33 insertions, 5 deletions
diff --git a/src/tools/miri/tests/compiletest.rs b/src/tools/miri/tests/compiletest.rs
index fe799216f0e..035846f0ef9 100644
--- a/src/tools/miri/tests/compiletest.rs
+++ b/src/tools/miri/tests/compiletest.rs
@@ -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
diff --git a/src/tools/miri/tests/pass/backtrace/backtrace-api-v0.rs b/src/tools/miri/tests/pass/backtrace/backtrace-api-v0.rs
index 5cd12959ca4..8d3173da400 100644
--- a/src/tools/miri/tests/pass/backtrace/backtrace-api-v0.rs
+++ b/src/tools/miri/tests/pass/backtrace/backtrace-api-v0.rs
@@ -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";
diff --git a/src/tools/miri/tests/pass/backtrace/backtrace-api-v0.stderr b/src/tools/miri/tests/pass/backtrace/backtrace-api-v0.stderr
index ee556b3e4a0..bc24d6de734 100644
--- a/src/tools/miri/tests/pass/backtrace/backtrace-api-v0.stderr
+++ b/src/tools/miri/tests/pass/backtrace/backtrace-api-v0.stderr
@@ -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)
diff --git a/src/tools/miri/tests/pass/backtrace/backtrace-api-v1.rs b/src/tools/miri/tests/pass/backtrace/backtrace-api-v1.rs
index 1e35574b39b..ad05271ca51 100644
--- a/src/tools/miri/tests/pass/backtrace/backtrace-api-v1.rs
+++ b/src/tools/miri/tests/pass/backtrace/backtrace-api-v1.rs
@@ -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";
diff --git a/src/tools/miri/tests/pass/backtrace/backtrace-api-v1.stderr b/src/tools/miri/tests/pass/backtrace/backtrace-api-v1.stderr
index 7dc281af31d..246e54becd8 100644
--- a/src/tools/miri/tests/pass/backtrace/backtrace-api-v1.stderr
+++ b/src/tools/miri/tests/pass/backtrace/backtrace-api-v1.stderr
@@ -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)