Auto merge of #78227 - SergioBenitez:test-stdout-threading, r=m-ou-se

Capture output from threads spawned in tests

This is revival of #75172.

Original text:
> Fixes #42474.
>
> r? `@​dtolnay` since you expressed interest in this, but feel free to redirect if you aren't the right person anymore.

---

Closes #75172.
This commit is contained in:
bors 2020-10-27 11:43:18 +00:00
commit 56d288fa46
14 changed files with 184 additions and 12 deletions

View file

@ -115,6 +115,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.