Skip to content

Commit 748498e

Browse files
committed
Add needs-unwind directive to tests where necessary
1 parent 3153584 commit 748498e

File tree

5 files changed

+27
-20
lines changed

5 files changed

+27
-20
lines changed

src/test/ui/backtrace.rs

+23-20
Original file line numberDiff line numberDiff line change
@@ -88,28 +88,31 @@ fn runtest(me: &str) {
8888
assert!(!s.contains("stack backtrace") && !s.contains(" - foo"),
8989
"bad output3: {}", s);
9090

91-
// Make sure a stack trace is printed
92-
let p = template(me).arg("double-fail").spawn().unwrap();
93-
let out = p.wait_with_output().unwrap();
94-
assert!(!out.status.success());
95-
let s = str::from_utf8(&out.stderr).unwrap();
96-
// loosened the following from double::h to double:: due to
97-
// spurious failures on mac, 32bit, optimized
98-
assert!(s.contains("stack backtrace") && contains_verbose_expected(s, "double"),
99-
"bad output3: {}", s);
91+
#[cfg(not(panic = "abort"))]
92+
{
93+
// Make sure a stack trace is printed
94+
let p = template(me).arg("double-fail").spawn().unwrap();
95+
let out = p.wait_with_output().unwrap();
96+
assert!(!out.status.success());
97+
let s = str::from_utf8(&out.stderr).unwrap();
98+
// loosened the following from double::h to double:: due to
99+
// spurious failures on mac, 32bit, optimized
100+
assert!(s.contains("stack backtrace") && contains_verbose_expected(s, "double"),
101+
"bad output3: {}", s);
100102

101-
// Make sure a stack trace isn't printed too many times
102-
let p = template(me).arg("double-fail")
103-
.env("RUST_BACKTRACE", "1").spawn().unwrap();
104-
let out = p.wait_with_output().unwrap();
105-
assert!(!out.status.success());
106-
let s = str::from_utf8(&out.stderr).unwrap();
107-
let mut i = 0;
108-
for _ in 0..2 {
109-
i += s[i + 10..].find("stack backtrace").unwrap() + 10;
103+
// Make sure a stack trace isn't printed too many times
104+
let p = template(me).arg("double-fail")
105+
.env("RUST_BACKTRACE", "1").spawn().unwrap();
106+
let out = p.wait_with_output().unwrap();
107+
assert!(!out.status.success());
108+
let s = str::from_utf8(&out.stderr).unwrap();
109+
let mut i = 0;
110+
for _ in 0..2 {
111+
i += s[i + 10..].find("stack backtrace").unwrap() + 10;
112+
}
113+
assert!(s[i + 10..].find("stack backtrace").is_none(),
114+
"bad output4: {}", s);
110115
}
111-
assert!(s[i + 10..].find("stack backtrace").is_none(),
112-
"bad output4: {}", s);
113116
}
114117

115118
fn main() {

src/test/ui/numbers-arithmetic/issue-8460.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// run-pass
22
#![allow(unused_must_use)]
33
// ignore-emscripten no threads support
4+
// needs-unwind
45
#![feature(rustc_attrs)]
56

67
use std::thread;

src/test/ui/panic-while-printing.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// run-pass
2+
// needs-unwind
23
// ignore-emscripten no subprocess support
34

45
#![feature(internal_output_capture)]

src/test/ui/process/multi-panic.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// run-pass
22
// ignore-emscripten no processes
33
// ignore-sgx no processes
4+
// needs-unwind
45

56
fn check_for_no_backtrace(test: std::process::Output) {
67
assert!(!test.status.success());

src/test/ui/test-attrs/test-panic-while-printing.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// compile-flags:--test
22
// run-pass
3+
// needs-unwind
34
// ignore-emscripten no subprocess support
45

56
use std::fmt;

0 commit comments

Comments
 (0)