Capture output from threads spawned in tests

Fixes #42474.
This commit is contained in:
Tyler Mandry 2020-08-04 18:42:36 -07:00 committed by Sergio Benitez
parent 6b9fbf212a
commit d0d0e78208
14 changed files with 177 additions and 12 deletions

View file

@ -113,6 +113,11 @@ impl Write for Sink {
Ok(())
}
}
impl io::LocalOutput for Sink {
fn clone_box(&self) -> Box<dyn io::LocalOutput> {
Box::new(Self(self.0.clone()))
}
}
/// Like a `thread::Builder::spawn` followed by a `join()`, but avoids the need
/// for `'static` bounds.