Rename run-make-support library output method to command_output

This commit is contained in:
Guillaume Gomez 2024-05-05 16:22:39 +02:00
parent 3c2cf2e50b
commit c04d09a76b
8 changed files with 13 additions and 12 deletions

View File

@ -73,7 +73,7 @@ impl Cc {
}
/// Get the [`Output`][::std::process::Output] of the finished process.
pub fn output(&mut self) -> ::std::process::Output {
pub fn command_output(&mut self) -> ::std::process::Output {
self.cmd.output().expect("failed to get output of finished process")
}
}

View File

@ -72,7 +72,7 @@ impl Clang {
}
/// Get the [`Output`][::std::process::Output] of the finished process.
pub fn output(&mut self) -> ::std::process::Output {
pub fn command_output(&mut self) -> ::std::process::Output {
self.cmd.output().expect("failed to get output of finished process")
}
}

View File

@ -164,7 +164,7 @@ pub fn set_host_rpath(cmd: &mut Command) {
///
/// impl CommandWrapper {
/// /// Get the [`Output`][::std::process::Output] of the finished process.
/// pub fn output(&mut self) -> Output { /* ... */ } // <- required `output()` method
/// pub fn command_output(&mut self) -> Output { /* ... */ } // <- required `command_output()` method
/// }
///
/// crate::impl_common_helpers!(CommandWrapper);
@ -242,7 +242,7 @@ macro_rules! impl_common_helpers {
let caller_location = ::std::panic::Location::caller();
let caller_line_number = caller_location.line();
let output = self.output();
let output = self.command_output();
if !output.status.success() {
handle_failed_output(&self.cmd, output, caller_line_number);
}
@ -255,7 +255,7 @@ macro_rules! impl_common_helpers {
let caller_location = ::std::panic::Location::caller();
let caller_line_number = caller_location.line();
let output = self.output();
let output = self.command_output();
if output.status.success() {
handle_failed_output(&self.cmd, output, caller_line_number);
}

View File

@ -44,7 +44,7 @@ impl LlvmReadobj {
/// Get the [`Output`][::std::process::Output] of the finished process.
#[track_caller]
pub fn output(&mut self) -> ::std::process::Output {
pub fn command_output(&mut self) -> ::std::process::Output {
self.cmd.output().expect("failed to get output of finished process")
}
}

View File

@ -171,7 +171,7 @@ impl Rustc {
/// Get the [`Output`][::std::process::Output] of the finished process.
#[track_caller]
pub fn output(&mut self) -> ::std::process::Output {
pub fn command_output(&mut self) -> ::std::process::Output {
// let's make sure we piped all the input and outputs
self.cmd.stdin(Stdio::piped());
self.cmd.stdout(Stdio::piped());
@ -196,7 +196,7 @@ impl Rustc {
let caller_location = std::panic::Location::caller();
let caller_line_number = caller_location.line();
let output = self.output();
let output = self.command_output();
if output.status.code().unwrap() != code {
handle_failed_output(&self.cmd, output, caller_line_number);
}

View File

@ -73,7 +73,7 @@ impl Rustdoc {
/// Get the [`Output`][::std::process::Output] of the finished process.
#[track_caller]
pub fn output(&mut self) -> ::std::process::Output {
pub fn command_output(&mut self) -> ::std::process::Output {
// let's make sure we piped all the input and outputs
self.cmd.stdin(Stdio::piped());
self.cmd.stdout(Stdio::piped());
@ -105,7 +105,7 @@ impl Rustdoc {
let caller_location = std::panic::Location::caller();
let caller_line_number = caller_location.line();
let output = self.output();
let output = self.command_output();
if output.status.code().unwrap() != code {
handle_failed_output(&self.cmd, output, caller_line_number);
}

View File

@ -13,7 +13,8 @@ fn main() {
let mut stable_path = PathBuf::from(env!("TMPDIR"));
stable_path.push("libstable.rmeta");
let output = rustc().input("main.rs").emit("metadata").extern_("stable", &stable_path).output();
let output =
rustc().input("main.rs").emit("metadata").extern_("stable", &stable_path).command_output();
let stderr = String::from_utf8_lossy(&output.stderr);
let version = include_str!(concat!(env!("S"), "/src/version"));

View File

@ -25,7 +25,7 @@ fn run(file: &Path, method: &str, expected_output: &str) {
.arg("--invoke")
.arg(method)
.arg(file)
.output()
.command_output()
.unwrap();
assert!(output.status.success());
assert_eq!(expected_output, String::from_utf8_lossy(&output.stdout));