Store positive instead of negative fail_fast.
This makes later negation much easier to interpret.
This commit is contained in:
@@ -59,7 +59,7 @@ impl fmt::Display for TestKind {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn try_run(build: &Build, cmd: &mut Command) {
|
fn try_run(build: &Build, cmd: &mut Command) {
|
||||||
if build.flags.cmd.no_fail_fast() {
|
if !build.fail_fast {
|
||||||
if !build.try_run(cmd) {
|
if !build.try_run(cmd) {
|
||||||
let failures = build.delayed_failures.get();
|
let failures = build.delayed_failures.get();
|
||||||
build.delayed_failures.set(failures + 1);
|
build.delayed_failures.set(failures + 1);
|
||||||
@@ -70,7 +70,7 @@ fn try_run(build: &Build, cmd: &mut Command) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn try_run_quiet(build: &Build, cmd: &mut Command) {
|
fn try_run_quiet(build: &Build, cmd: &mut Command) {
|
||||||
if build.flags.cmd.no_fail_fast() {
|
if !build.fail_fast {
|
||||||
if !build.try_run_quiet(cmd) {
|
if !build.try_run_quiet(cmd) {
|
||||||
let failures = build.delayed_failures.get();
|
let failures = build.delayed_failures.get();
|
||||||
build.delayed_failures.set(failures + 1);
|
build.delayed_failures.set(failures + 1);
|
||||||
@@ -128,7 +128,7 @@ pub fn cargo(build: &Build, stage: u32, host: &str) {
|
|||||||
|
|
||||||
let mut cargo = build.cargo(compiler, Mode::Tool, host, "test");
|
let mut cargo = build.cargo(compiler, Mode::Tool, host, "test");
|
||||||
cargo.arg("--manifest-path").arg(build.src.join("src/tools/cargo/Cargo.toml"));
|
cargo.arg("--manifest-path").arg(build.src.join("src/tools/cargo/Cargo.toml"));
|
||||||
if build.flags.cmd.no_fail_fast() {
|
if !build.fail_fast {
|
||||||
cargo.arg("--no-fail-fast");
|
cargo.arg("--no-fail-fast");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -448,7 +448,7 @@ pub fn krate(build: &Build,
|
|||||||
cargo.arg("--manifest-path")
|
cargo.arg("--manifest-path")
|
||||||
.arg(build.src.join(path).join("Cargo.toml"))
|
.arg(build.src.join(path).join("Cargo.toml"))
|
||||||
.arg("--features").arg(features);
|
.arg("--features").arg(features);
|
||||||
if test_kind.subcommand() == "test" && build.flags.cmd.no_fail_fast() {
|
if test_kind.subcommand() == "test" && !build.fail_fast {
|
||||||
cargo.arg("--no-fail-fast");
|
cargo.arg("--no-fail-fast");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -669,7 +669,7 @@ pub fn bootstrap(build: &Build) {
|
|||||||
.env("CARGO_TARGET_DIR", build.out.join("bootstrap"))
|
.env("CARGO_TARGET_DIR", build.out.join("bootstrap"))
|
||||||
.env("RUSTC_BOOTSTRAP", "1")
|
.env("RUSTC_BOOTSTRAP", "1")
|
||||||
.env("RUSTC", &build.initial_rustc);
|
.env("RUSTC", &build.initial_rustc);
|
||||||
if build.flags.cmd.no_fail_fast() {
|
if !build.fail_fast {
|
||||||
cmd.arg("--no-fail-fast");
|
cmd.arg("--no-fail-fast");
|
||||||
}
|
}
|
||||||
cmd.arg("--").args(&build.flags.cmd.test_args());
|
cmd.arg("--").args(&build.flags.cmd.test_args());
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ pub enum Subcommand {
|
|||||||
Test {
|
Test {
|
||||||
paths: Vec<PathBuf>,
|
paths: Vec<PathBuf>,
|
||||||
test_args: Vec<String>,
|
test_args: Vec<String>,
|
||||||
no_fail_fast: bool,
|
fail_fast: bool,
|
||||||
},
|
},
|
||||||
Bench {
|
Bench {
|
||||||
paths: Vec<PathBuf>,
|
paths: Vec<PathBuf>,
|
||||||
@@ -278,7 +278,7 @@ Arguments:
|
|||||||
Subcommand::Test {
|
Subcommand::Test {
|
||||||
paths: paths,
|
paths: paths,
|
||||||
test_args: matches.opt_strs("test-args"),
|
test_args: matches.opt_strs("test-args"),
|
||||||
no_fail_fast: matches.opt_present("no-fail-fast"),
|
fail_fast: !matches.opt_present("no-fail-fast"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
"bench" => {
|
"bench" => {
|
||||||
@@ -354,9 +354,9 @@ impl Subcommand {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn no_fail_fast(&self) -> bool {
|
pub fn fail_fast(&self) -> bool {
|
||||||
match *self {
|
match *self {
|
||||||
Subcommand::Test { no_fail_fast, .. } => no_fail_fast,
|
Subcommand::Test { fail_fast, .. } => fail_fast,
|
||||||
_ => false,
|
_ => false,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -167,6 +167,7 @@ pub struct Build {
|
|||||||
cargo_info: channel::GitInfo,
|
cargo_info: channel::GitInfo,
|
||||||
rls_info: channel::GitInfo,
|
rls_info: channel::GitInfo,
|
||||||
local_rebuild: bool,
|
local_rebuild: bool,
|
||||||
|
fail_fast: bool,
|
||||||
|
|
||||||
// Stage 0 (downloaded) compiler and cargo or their local rust equivalents.
|
// Stage 0 (downloaded) compiler and cargo or their local rust equivalents.
|
||||||
initial_rustc: PathBuf,
|
initial_rustc: PathBuf,
|
||||||
@@ -240,12 +241,12 @@ impl Build {
|
|||||||
let rust_info = channel::GitInfo::new(&src);
|
let rust_info = channel::GitInfo::new(&src);
|
||||||
let cargo_info = channel::GitInfo::new(&src.join("src/tools/cargo"));
|
let cargo_info = channel::GitInfo::new(&src.join("src/tools/cargo"));
|
||||||
let rls_info = channel::GitInfo::new(&src.join("src/tools/rls"));
|
let rls_info = channel::GitInfo::new(&src.join("src/tools/rls"));
|
||||||
let src_is_git = src.join(".git").exists();
|
|
||||||
|
|
||||||
Build {
|
Build {
|
||||||
initial_rustc: config.initial_rustc.clone(),
|
initial_rustc: config.initial_rustc.clone(),
|
||||||
initial_cargo: config.initial_cargo.clone(),
|
initial_cargo: config.initial_cargo.clone(),
|
||||||
local_rebuild: config.local_rebuild,
|
local_rebuild: config.local_rebuild,
|
||||||
|
fail_fast: flags.cmd.fail_fast(),
|
||||||
|
|
||||||
flags: flags,
|
flags: flags,
|
||||||
config: config,
|
config: config,
|
||||||
|
|||||||
Reference in New Issue
Block a user