mirror of
https://github.com/rust-lang/cargo.git
synced 2025-09-28 11:20:36 +00:00
Print environment variables for cargo run
in extra verbose mode
This commit is contained in:
parent
f13759445f
commit
5405cd3a8b
@ -100,6 +100,10 @@ pub fn run(
|
||||
// by `compile.target_process` (the package's root directory)
|
||||
process.args(args).cwd(config.cwd());
|
||||
|
||||
if config.extra_verbose() {
|
||||
process.display_env_vars();
|
||||
}
|
||||
|
||||
config.shell().status("Running", process.to_string())?;
|
||||
|
||||
process.exec_replace()
|
||||
|
@ -1,6 +1,8 @@
|
||||
//! Tests for the `cargo run` command.
|
||||
|
||||
use cargo_test_support::{basic_bin_manifest, basic_lib_manifest, project, Project};
|
||||
use cargo_test_support::{
|
||||
basic_bin_manifest, basic_lib_manifest, basic_manifest, project, Project,
|
||||
};
|
||||
use cargo_util::paths::dylib_path_envvar;
|
||||
|
||||
#[cargo_test]
|
||||
@ -1416,6 +1418,24 @@ fn default_run_workspace() {
|
||||
p.cargo("run").with_stdout("run-a").run();
|
||||
}
|
||||
|
||||
#[cargo_test]
|
||||
fn print_env_verbose() {
|
||||
let p = project()
|
||||
.file("Cargo.toml", &basic_manifest("a", "0.0.1"))
|
||||
.file("src/main.rs", r#"fn main() {println!("run-a");}"#)
|
||||
.build();
|
||||
|
||||
p.cargo("run -vv")
|
||||
.with_stderr(
|
||||
"\
|
||||
[COMPILING] a v0.0.1 ([CWD])
|
||||
[RUNNING] `[..]CARGO_MANIFEST_DIR=[CWD][..] rustc --crate-name a[..]`
|
||||
[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]
|
||||
[RUNNING] `[..]CARGO_MANIFEST_DIR=[CWD][..] target/debug/a[EXE]`",
|
||||
)
|
||||
.run();
|
||||
}
|
||||
|
||||
#[cargo_test]
|
||||
#[cfg(target_os = "macos")]
|
||||
fn run_link_system_path_macos() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user