.map(|s| s.to_string()),
);
- if args.is_present("quiet") {
- test_args.push("-q".to_string())
- }
-
let err = ops::run_tests(&ws, &ops, &test_args)?;
match err {
None => Ok(()),
use semver::Version;
use super::BuildContext;
-use crate::core::{Edition, Package, PackageId, Target, TargetKind};
+use crate::core::{Edition, Package, PackageId, Target};
use crate::util::{self, join_paths, process, CargoResult, CfgExpr, Config, ProcessBuilder};
pub struct Doctest {
/// A structure returning the result of a compilation.
pub struct Compilation<'cfg> {
/// An array of all tests created during this compilation.
- pub tests: Vec<(Package, TargetKind, String, PathBuf)>,
+ pub tests: Vec<(Package, Target, PathBuf)>,
/// An array of all binaries created.
pub binaries: Vec<PathBuf>,
if unit.mode == CompileMode::Test {
self.compilation.tests.push((
unit.pkg.clone(),
- unit.target.kind().clone(),
- unit.target.name().to_string(),
+ unit.target.clone(),
output.path.clone(),
));
} else if unit.target.is_bin() || unit.target.is_bin_example() {
use crate::core::compiler::{Compilation, Doctest};
use crate::core::Workspace;
+use crate::core::shell::Verbosity;
use crate::ops;
use crate::util::errors::CargoResult;
use crate::util::{CargoTestError, ProcessError, Test};
let mut errors = Vec::new();
- for &(ref pkg, ref kind, ref test, ref exe) in &compilation.tests {
+ for &(ref pkg, ref target, ref exe) in &compilation.tests {
+ let kind = target.kind();
+ let test = target.name().to_string();
let exe_display = exe.strip_prefix(cwd).unwrap_or(exe).display();
let mut cmd = compilation.target_process(exe, pkg)?;
cmd.args(test_args);
+ if target.harness() && config.shell().verbosity() == Verbosity::Quiet {
+ cmd.arg("--quiet");
+ }
config
.shell()
.concise(|shell| shell.status("Running", &exe_display))?;