Skip to content

Commit 333b8b3

Browse files
committed
---
yaml --- r: 273591 b: refs/heads/beta c: 8a7b1bc h: refs/heads/master i: 273589: d612311 273587: f560388 273583: ee21c2d
1 parent b86e9b8 commit 333b8b3

File tree

2 files changed

+21
-4
lines changed

2 files changed

+21
-4
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ refs/tags/0.9: 36870b185fc5f5486636d4515f0e22677493f225
2323
refs/tags/0.10: ac33f2b15782272ae348dbd7b14b8257b2148b5a
2424
refs/tags/0.11.0: e1247cb1d0d681be034adb4b558b5a0c0d5720f9
2525
refs/tags/0.12.0: f0c419429ef30723ceaf6b42f9b5a2aeb5d2e2d1
26-
refs/heads/beta: 24059f74d7669634dedc409293a0635f16c6ae76
26+
refs/heads/beta: 8a7b1bca045b3b582f53337799b90a9309adc96b
2727
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
2828
refs/heads/tmp: e06d2ad9fcd5027bcaac5b08fc9aa39a49d0ecd3
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f

branches/beta/src/test/run-pass/backtrace.rs

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,30 @@ fn template(me: &str) -> Command {
5151
return m;
5252
}
5353

54+
fn expected(fn_name: &str) -> String {
55+
// FIXME(#32481)
56+
//
57+
// On windows, we read the function name from debuginfo using some
58+
// system APIs. For whatever reason, these APIs seem to use the
59+
// "name" field, which is only the "relative" name, not the full
60+
// name with namespace info, so we just see `foo` and not
61+
// `backtrace::foo` as we see on linux (which uses the linkage
62+
// name).
63+
64+
if cfg!(windows) {
65+
format!(" - {}", fn_name)
66+
} else {
67+
format!(" - backtrace::{}", fn_name)
68+
}
69+
}
70+
5471
fn runtest(me: &str) {
5572
// Make sure that the stack trace is printed
5673
let p = template(me).arg("fail").env("RUST_BACKTRACE", "1").spawn().unwrap();
5774
let out = p.wait_with_output().unwrap();
5875
assert!(!out.status.success());
5976
let s = str::from_utf8(&out.stderr).unwrap();
60-
assert!(s.contains("stack backtrace") && s.contains(" - backtrace::foo"),
77+
assert!(s.contains("stack backtrace") && s.contains(&expected("foo")),
6178
"bad output: {}", s);
6279

6380
// Make sure the stack trace is *not* printed
@@ -67,7 +84,7 @@ fn runtest(me: &str) {
6784
let out = p.wait_with_output().unwrap();
6885
assert!(!out.status.success());
6986
let s = str::from_utf8(&out.stderr).unwrap();
70-
assert!(!s.contains("stack backtrace") && !s.contains(" - backtrace::foo"),
87+
assert!(!s.contains("stack backtrace") && !s.contains(&expected("foo")),
7188
"bad output2: {}", s);
7289

7390
// Make sure a stack trace is printed
@@ -77,7 +94,7 @@ fn runtest(me: &str) {
7794
let s = str::from_utf8(&out.stderr).unwrap();
7895
// loosened the following from double::h to double:: due to
7996
// spurious failures on mac, 32bit, optimized
80-
assert!(s.contains("stack backtrace") && s.contains(" - backtrace::double"),
97+
assert!(s.contains("stack backtrace") && s.contains(&expected("double")),
8198
"bad output3: {}", s);
8299

83100
// Make sure a stack trace isn't printed too many times

0 commit comments

Comments
 (0)