mirror of
https://github.com/rust-lang/cargo.git
synced 2025-09-28 11:20:36 +00:00
Don't print to raw stderr in test
Avoids polluting the output of tests with Cargo's build output.
This commit is contained in:
parent
974eb438da
commit
d0983fb3f0
@ -1,14 +1,17 @@
|
|||||||
//! Tests for the `cargo build` command.
|
//! Tests for the `cargo build` command.
|
||||||
|
|
||||||
use cargo::{
|
use cargo::{
|
||||||
core::compiler::CompileMode, core::Workspace, ops::CompileOptions,
|
core::compiler::CompileMode,
|
||||||
util::paths::dylib_path_envvar, Config,
|
core::{Shell, Workspace},
|
||||||
|
ops::CompileOptions,
|
||||||
|
util::paths::dylib_path_envvar,
|
||||||
|
Config,
|
||||||
};
|
};
|
||||||
use cargo_test_support::paths::{root, CargoPathExt};
|
use cargo_test_support::paths::{root, CargoPathExt};
|
||||||
use cargo_test_support::registry::Package;
|
use cargo_test_support::registry::Package;
|
||||||
use cargo_test_support::{
|
use cargo_test_support::{
|
||||||
basic_bin_manifest, basic_lib_manifest, basic_manifest, is_nightly, lines_match, main_file,
|
basic_bin_manifest, basic_lib_manifest, basic_manifest, is_nightly, lines_match, main_file,
|
||||||
project, rustc_host, sleep_ms, symlink_supported, t, Execs, ProjectBuilder,
|
paths, project, rustc_host, sleep_ms, symlink_supported, t, Execs, ProjectBuilder,
|
||||||
};
|
};
|
||||||
use std::env;
|
use std::env;
|
||||||
use std::fs;
|
use std::fs;
|
||||||
@ -427,7 +430,8 @@ fn cargo_compile_api_exposes_artifact_paths() {
|
|||||||
.file("src/bin.rs", "pub fn main() {}")
|
.file("src/bin.rs", "pub fn main() {}")
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
let config = Config::default().unwrap();
|
let shell = Shell::from_write(Box::new(Vec::new()));
|
||||||
|
let config = Config::new(shell, env::current_dir().unwrap(), paths::home());
|
||||||
let ws = Workspace::new(&p.root().join("Cargo.toml"), &config).unwrap();
|
let ws = Workspace::new(&p.root().join("Cargo.toml"), &config).unwrap();
|
||||||
let compile_options = CompileOptions::new(ws.config(), CompileMode::Build).unwrap();
|
let compile_options = CompileOptions::new(ws.config(), CompileMode::Build).unwrap();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user