Skip to content

Commit 60f8f6b

Browse files
committed
compiletest: Add support for // ignore-musl
Add the ability to ignore a test based on the environment of the triple being used.
1 parent 7dd6215 commit 60f8f6b

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/compiletest/header.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,9 @@ pub fn is_test_ignored(config: &Config, testfile: &Path) -> bool {
170170
format!("ignore-{}",
171171
config.stage_id.split('-').next().unwrap())
172172
}
173+
fn ignore_env(config: &Config) -> String {
174+
format!("ignore-{}", util::get_env(&config.target).unwrap_or("<unknown>"))
175+
}
173176
fn ignore_gdb(config: &Config, line: &str) -> bool {
174177
if config.mode != common::DebugInfoGdb {
175178
return false;
@@ -231,6 +234,7 @@ pub fn is_test_ignored(config: &Config, testfile: &Path) -> bool {
231234
!parse_name_directive(ln, &ignore_target(config)) &&
232235
!parse_name_directive(ln, &ignore_architecture(config)) &&
233236
!parse_name_directive(ln, &ignore_stage(config)) &&
237+
!parse_name_directive(ln, &ignore_env(config)) &&
234238
!(config.mode == common::Pretty && parse_name_directive(ln, "ignore-pretty")) &&
235239
!(config.target != config.host && parse_name_directive(ln, "ignore-cross-compile")) &&
236240
!ignore_gdb(config, ln) &&

src/compiletest/util.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ pub fn get_arch(triple: &str) -> &'static str {
6060
panic!("Cannot determine Architecture from triple");
6161
}
6262

63+
pub fn get_env(triple: &str) -> Option<&str> {
64+
triple.split('-').nth(3)
65+
}
66+
6367
pub fn make_new_path(path: &str) -> String {
6468
assert!(cfg!(windows));
6569
// Windows just uses PATH as the library search path, so we have to

0 commit comments

Comments
 (0)