#![allow(clippy::disallowed_macros)]
use hyperlight_host::sandbox::uninitialized::UninitializedSandbox;
use hyperlight_host::{GuestBinary, Result};
use hyperlight_testing::simple_guest_as_string;
use tracing_chrome::ChromeLayerBuilder;
use tracing_subscriber::prelude::*;
fn main() -> Result<()> {
let (chrome_layer, _guard) = ChromeLayerBuilder::new().build();
tracing_subscriber::registry().with(chrome_layer).init();
let simple_guest_path =
simple_guest_as_string().expect("Cannot find the guest binary at the expected location.");
let usandbox = UninitializedSandbox::new(GuestBinary::FilePath(simple_guest_path), None)?;
let mut sbox = usandbox.evolve().unwrap();
let current_time = std::time::Instant::now();
let res: String = sbox.call("Echo", "Hello, World!".to_string())?;
let elapsed = current_time.elapsed();
println!("Function call finished in {:?}.", elapsed);
assert_eq!(res, "Hello, World!");
Ok(())
}