compiletest: Add support for // ignore-musl
Add the ability to ignore a test based on the environment of the triple being used.
This commit is contained in:
parent
7dd62155d8
commit
60f8f6bde9
@ -170,6 +170,9 @@ pub fn is_test_ignored(config: &Config, testfile: &Path) -> bool {
|
|||||||
format!("ignore-{}",
|
format!("ignore-{}",
|
||||||
config.stage_id.split('-').next().unwrap())
|
config.stage_id.split('-').next().unwrap())
|
||||||
}
|
}
|
||||||
|
fn ignore_env(config: &Config) -> String {
|
||||||
|
format!("ignore-{}", util::get_env(&config.target).unwrap_or("<unknown>"))
|
||||||
|
}
|
||||||
fn ignore_gdb(config: &Config, line: &str) -> bool {
|
fn ignore_gdb(config: &Config, line: &str) -> bool {
|
||||||
if config.mode != common::DebugInfoGdb {
|
if config.mode != common::DebugInfoGdb {
|
||||||
return false;
|
return false;
|
||||||
@ -231,6 +234,7 @@ pub fn is_test_ignored(config: &Config, testfile: &Path) -> bool {
|
|||||||
!parse_name_directive(ln, &ignore_target(config)) &&
|
!parse_name_directive(ln, &ignore_target(config)) &&
|
||||||
!parse_name_directive(ln, &ignore_architecture(config)) &&
|
!parse_name_directive(ln, &ignore_architecture(config)) &&
|
||||||
!parse_name_directive(ln, &ignore_stage(config)) &&
|
!parse_name_directive(ln, &ignore_stage(config)) &&
|
||||||
|
!parse_name_directive(ln, &ignore_env(config)) &&
|
||||||
!(config.mode == common::Pretty && parse_name_directive(ln, "ignore-pretty")) &&
|
!(config.mode == common::Pretty && parse_name_directive(ln, "ignore-pretty")) &&
|
||||||
!(config.target != config.host && parse_name_directive(ln, "ignore-cross-compile")) &&
|
!(config.target != config.host && parse_name_directive(ln, "ignore-cross-compile")) &&
|
||||||
!ignore_gdb(config, ln) &&
|
!ignore_gdb(config, ln) &&
|
||||||
|
@ -60,6 +60,10 @@ pub fn get_arch(triple: &str) -> &'static str {
|
|||||||
panic!("Cannot determine Architecture from triple");
|
panic!("Cannot determine Architecture from triple");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn get_env(triple: &str) -> Option<&str> {
|
||||||
|
triple.split('-').nth(3)
|
||||||
|
}
|
||||||
|
|
||||||
pub fn make_new_path(path: &str) -> String {
|
pub fn make_new_path(path: &str) -> String {
|
||||||
assert!(cfg!(windows));
|
assert!(cfg!(windows));
|
||||||
// Windows just uses PATH as the library search path, so we have to
|
// Windows just uses PATH as the library search path, so we have to
|
||||||
|
Loading…
x
Reference in New Issue
Block a user