Skip to content

Commit

Permalink
Rollup merge of #64258 - smaeul:patch/arm-tests, r=Mark-Simulacrum
Browse files Browse the repository at this point in the history
compiletest: Match suffixed environments

This fixes a case where an `ignore-musl` test was not ignored on
`armv7-unknown-linux-musleabihf` because the environment did not exactly
match. Only enforce that the environment starts with the argument to
`ignore-`.
  • Loading branch information
Centril authored Sep 7, 2019
2 parents 448b38f + 2bcabf6 commit 635c3bc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/tools/compiletest/src/header.rs
Original file line number Diff line number Diff line change
Expand Up @@ -835,10 +835,10 @@ impl Config {

if name == "test" ||
util::matches_os(&self.target, name) || // target
util::matches_env(&self.target, name) || // env
name == util::get_arch(&self.target) || // architecture
name == util::get_pointer_width(&self.target) || // pointer width
name == self.stage_id.split('-').next().unwrap() || // stage
Some(name) == util::get_env(&self.target) || // env
(self.target != self.host && name == "cross-compile") ||
match self.compare_mode {
Some(CompareMode::Nll) => name == "compare-mode-nll",
Expand Down
8 changes: 6 additions & 2 deletions src/tools/compiletest/src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,12 @@ pub fn get_arch(triple: &str) -> &'static str {
panic!("Cannot determine Architecture from triple");
}

pub fn get_env(triple: &str) -> Option<&str> {
triple.split('-').nth(3)
pub fn matches_env(triple: &str, name: &str) -> bool {
if let Some(env) = triple.split('-').nth(3) {
env.starts_with(name)
} else {
false
}
}

pub fn get_pointer_width(triple: &str) -> &'static str {
Expand Down

0 comments on commit 635c3bc

Please sign in to comment.