1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-18 13:22:55 -05:00
denoland-deno/tests/util/server/src/test_server.rs
David Sherret 47f7bed677
chore: enable clippy::print_stdout and clippy::print_stderr (#23732)
1. Generally we should prefer to use the `log` crate.
2. I very often accidentally commit `eprintln`s.

When we should use `println` or `eprintln`, it's not too bad to be a bit
more verbose and ignore the lint rule.
2024-05-08 22:45:06 -04:00

21 lines
650 B
Rust

// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
#![allow(clippy::print_stdout)]
#![allow(clippy::print_stderr)]
fn main() {
setup_panic_hook();
test_server::servers::run_all_servers();
}
fn setup_panic_hook() {
// Tokio does not exit the process when a task panics, so we define a custom
// panic hook to implement this behaviour.
let orig_hook = std::panic::take_hook();
std::panic::set_hook(Box::new(move |panic_info| {
eprintln!("\n============================================================");
eprintln!("Test server panicked!\n");
orig_hook(panic_info);
std::process::exit(1);
}));
}