@@ -58,54 +58,8 @@ fn runtest(me: &str) {
5858 let s = str:: from_utf8 ( & out. stderr ) . unwrap ( ) ;
5959 assert ! ( s. contains( "stack backtrace" ) && s. contains( & expected( "foo" ) ) ,
6060 "bad output: {}" , s) ;
61-
62- // Make sure than the short version cleans the backtrace.
63- let p = template ( me) . arg ( "fail" ) . env ( "RUST_BACKTRACE" , "1" ) . spawn ( ) . unwrap ( ) ;
64- let out = p. wait_with_output ( ) . unwrap ( ) ;
65- assert ! ( !out. status. success( ) ) ;
66- let s = str:: from_utf8 ( & out. stderr ) . unwrap ( ) ;
67- let removed_symbols = & [
68- "std::sys::imp::backtrace" ,
69- "std::sys_common::backtrace" ,
70- "std::panicking" ,
71- "core::panicking" ,
72- "rust_begin_unwind" ,
73- "code::result::unwrap_failed" ,
74- "std::panicking::try::do_call" ,
75- "__rust_maybe_catch_panic" ,
76- "__libc_start_main" ,
77- "__rust_try" ,
78- "_start" ,
79- ] ;
80- for symbol in removed_symbols {
81- assert ! ( !s. contains( symbol) ,
82- "{} should be removed from the backtrace\n {}" ,
83- symbol, s) ;
84- }
8561 assert ! ( s. contains( " 0:" ) , "the frame number should start at 0" ) ;
8662
87- // Only on linux for _start and __libc_start_main
88- #[ cfg( target_os="linux" ) ]
89- {
90- // Make sure than the short version cleans the backtrace.
91- let p = template ( me) . arg ( "fail" ) . env ( "RUST_BACKTRACE" , "full" ) . spawn ( ) . unwrap ( ) ;
92- let out = p. wait_with_output ( ) . unwrap ( ) ;
93- assert ! ( !out. status. success( ) ) ;
94- let s = str:: from_utf8 ( & out. stderr ) . unwrap ( ) ;
95- let should_be_present = & [
96- "std::panicking" ,
97- "__rust_maybe_catch_panic" ,
98- "__libc_start_main" ,
99- "_start" ,
100- ] ;
101- for symbol in should_be_present {
102- // May give false positive due to inlining.
103- assert ! ( s. contains( symbol) ,
104- "the full version of the backtrace should contain {}" ,
105- symbol) ;
106- }
107- }
108-
10963 // Make sure the stack trace is *not* printed
11064 // (Remove RUST_BACKTRACE from our own environment, in case developer
11165 // is running `make check` with it on.)
0 commit comments