run_make_support: allow obtaining raw stdout/stderr
And match `stdout/stderr` lossy UTF-8 helpers.
This commit is contained in:
parent
f225713007
commit
921e2f8f66
1 changed files with 18 additions and 0 deletions
|
@ -222,6 +222,12 @@ pub struct CompletedProcess {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl CompletedProcess {
|
impl CompletedProcess {
|
||||||
|
#[must_use]
|
||||||
|
#[track_caller]
|
||||||
|
pub fn stdout(&self) -> Vec<u8> {
|
||||||
|
self.output.stdout.clone()
|
||||||
|
}
|
||||||
|
|
||||||
#[must_use]
|
#[must_use]
|
||||||
#[track_caller]
|
#[track_caller]
|
||||||
pub fn stdout_utf8(&self) -> String {
|
pub fn stdout_utf8(&self) -> String {
|
||||||
|
@ -234,12 +240,24 @@ impl CompletedProcess {
|
||||||
String::from_utf8_lossy(&self.output.stdout.clone()).to_string()
|
String::from_utf8_lossy(&self.output.stdout.clone()).to_string()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[must_use]
|
||||||
|
#[track_caller]
|
||||||
|
pub fn stderr(&self) -> Vec<u8> {
|
||||||
|
self.output.stderr.clone()
|
||||||
|
}
|
||||||
|
|
||||||
#[must_use]
|
#[must_use]
|
||||||
#[track_caller]
|
#[track_caller]
|
||||||
pub fn stderr_utf8(&self) -> String {
|
pub fn stderr_utf8(&self) -> String {
|
||||||
String::from_utf8(self.output.stderr.clone()).expect("stderr is not valid UTF-8")
|
String::from_utf8(self.output.stderr.clone()).expect("stderr is not valid UTF-8")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[must_use]
|
||||||
|
#[track_caller]
|
||||||
|
pub fn invalid_stderr_utf8(&self) -> String {
|
||||||
|
String::from_utf8_lossy(&self.output.stderr.clone()).to_string()
|
||||||
|
}
|
||||||
|
|
||||||
#[must_use]
|
#[must_use]
|
||||||
pub fn status(&self) -> ExitStatus {
|
pub fn status(&self) -> ExitStatus {
|
||||||
self.output.status
|
self.output.status
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue