]>
git.proxmox.com Git - rustc.git/blob - src/test/ui/multi-panic.rs
2 // ignore-cloudabi no processes
3 // ignore-emscripten no processes
4 // ignore-sgx no processes
6 fn check_for_no_backtrace(test
: std
::process
::Output
) {
7 assert
!(!test
.status
.success());
8 let err
= String
::from_utf8_lossy(&test
.stderr
);
9 let mut it
= err
.lines();
11 assert_eq
!(it
.next().map(|l
| l
.starts_with("thread '<unnamed>' panicked at")), Some(true));
12 assert_eq
!(it
.next(), Some("note: run with `RUST_BACKTRACE=1` \
13 environment variable to display a backtrace"));
14 assert_eq
!(it
.next().map(|l
| l
.starts_with("thread 'main' panicked at")), Some(true));
15 assert_eq
!(it
.next(), None
);
19 let args
: Vec
<String
> = std
::env
::args().collect();
20 if args
.len() > 1 && args
[1] == "run_test" {
21 let _
= std
::thread
::spawn(|| {
27 let test
= std
::process
::Command
::new(&args
[0]).arg("run_test")
28 .env_remove("RUST_BACKTRACE")
31 check_for_no_backtrace(test
);
32 let test
= std
::process
::Command
::new(&args
[0]).arg("run_test")
33 .env("RUST_BACKTRACE","0")
36 check_for_no_backtrace(test
);