Skip to content

Commit 635c3bc

Browse files
authored
Rollup merge of #64258 - smaeul:patch/arm-tests, r=Mark-Simulacrum
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-`.
2 parents 448b38f + 2bcabf6 commit 635c3bc

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/tools/compiletest/src/header.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -835,10 +835,10 @@ impl Config {
835835

836836
if name == "test" ||
837837
util::matches_os(&self.target, name) || // target
838+
util::matches_env(&self.target, name) || // env
838839
name == util::get_arch(&self.target) || // architecture
839840
name == util::get_pointer_width(&self.target) || // pointer width
840841
name == self.stage_id.split('-').next().unwrap() || // stage
841-
Some(name) == util::get_env(&self.target) || // env
842842
(self.target != self.host && name == "cross-compile") ||
843843
match self.compare_mode {
844844
Some(CompareMode::Nll) => name == "compare-mode-nll",

src/tools/compiletest/src/util.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,12 @@ pub fn get_arch(triple: &str) -> &'static str {
105105
panic!("Cannot determine Architecture from triple");
106106
}
107107

108-
pub fn get_env(triple: &str) -> Option<&str> {
109-
triple.split('-').nth(3)
108+
pub fn matches_env(triple: &str, name: &str) -> bool {
109+
if let Some(env) = triple.split('-').nth(3) {
110+
env.starts_with(name)
111+
} else {
112+
false
113+
}
110114
}
111115

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

0 commit comments

Comments
 (0)