fn trace_from_another_thread()

in reverie-ptrace/src/trace/mod.rs [1212:1229]


    fn trace_from_another_thread() -> Result<(), Box<dyn std::error::Error + 'static>> {
        let (pid, tracee) = trace(|| 42, Options::empty()).unwrap();

        assert_eq!(
            // Try resuming from another thread, which should fail.
            thread::spawn(move || tracee.resume(None)).join().unwrap(),
            // The process didn't actually die, this is just how ESRCH was
            // interpretted.
            Err(Error::Died(Zombie::new(pid)))
        );

        assert_eq!(
            Stopped(pid).resume(None)?.wait()?,
            Wait::Exited(pid, ExitStatus::Exited(42))
        );

        Ok(())
    }