Correct code to not run host-only tests.

This commit is contained in:
Mark Simulacrum 2017-08-10 21:17:42 +05:00
parent cec68167fd
commit 657196830f
2 changed files with 7 additions and 3 deletions

View file

@ -127,9 +127,7 @@ impl StepDescription {
// Determine the targets participating in this rule.
let targets = if self.only_hosts {
// If --target was specified but --host wasn't specified, don't run
// any host-only tests.
if build.config.hosts.is_empty() && !build.config.targets.is_empty() {
if build.config.run_host_only {
&[]
} else if self.only_build {
build.build_triple()

View file

@ -56,6 +56,8 @@ pub struct Config {
pub profiler: bool,
pub ignore_git: bool,
pub run_host_only: bool,
pub on_fail: Option<String>,
pub stage: Option<u32>,
pub keep_stage: Option<u32>,
@ -305,6 +307,9 @@ impl Config {
config.incremental = flags.incremental;
config.keep_stage = flags.keep_stage;
// If --target was specified but --host wasn't specified, don't run any host-only tests.
config.run_host_only = flags.host.is_empty() && !flags.target.is_empty();
let toml = file.map(|file| {
let mut f = t!(File::open(&file));
let mut contents = String::new();
@ -351,6 +356,7 @@ impl Config {
config.targets
};
config.nodejs = build.nodejs.map(PathBuf::from);
config.gdb = build.gdb.map(PathBuf::from);
config.python = build.python.map(PathBuf::from);