2024-01-01 14:58:21 -05:00
|
|
|
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
2020-09-21 08:26:41 -04:00
|
|
|
|
2024-05-08 22:45:06 -04:00
|
|
|
#![allow(clippy::print_stdout)]
|
|
|
|
#![allow(clippy::print_stderr)]
|
|
|
|
|
2020-07-04 13:05:01 -04:00
|
|
|
fn main() {
|
2024-05-06 21:06:01 -04:00
|
|
|
setup_panic_hook();
|
2024-02-19 08:34:24 -05:00
|
|
|
test_server::servers::run_all_servers();
|
2020-07-04 13:05:01 -04:00
|
|
|
}
|
2024-05-06 21:06:01 -04:00
|
|
|
|
|
|
|
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);
|
|
|
|
}));
|
|
|
|
}
|