Fix failing backtrace ui tests

This commit is contained in:
Jane Lusby 2020-02-11 16:57:22 -08:00
parent d2b08c7e93
commit 090a1571d8
2 changed files with 3 additions and 2 deletions

View File

@ -70,6 +70,7 @@ unsafe fn _print_fmt(fmt: &mut fmt::Formatter<'_>, print_fmt: PrintFmt) -> fmt::
let mut print_path = move |fmt: &mut fmt::Formatter<'_>, bows: BytesOrWideString<'_>| {
output_filename(fmt, bows, print_fmt, cwd.as_ref())
};
write!(fmt, "stack backtrace:\n")?;
let mut bt_fmt = BacktraceFmt::new(fmt, print_fmt, &mut print_path);
bt_fmt.add_context()?;
let mut idx = 0;

View File

@ -16,9 +16,9 @@ use std::str;
fn main() {
let args: Vec<String> = env::args().collect();
if args.len() >= 2 && args[1] == "force" {
println!("{}", std::backtrace::Backtrace::force_capture());
println!("stack backtrace:\n{}", std::backtrace::Backtrace::force_capture());
} else if args.len() >= 2 {
println!("{}", std::backtrace::Backtrace::capture());
println!("stack backtrace:\n{}", std::backtrace::Backtrace::capture());
} else {
runtest(&args[0]);
println!("test ok");