]> git.lizzy.rs Git - rust.git/commitdiff
compiletest: Add support for `// ignore-musl`
authorAlex Crichton <alex@alexcrichton.com>
Fri, 24 Apr 2015 01:40:54 +0000 (18:40 -0700)
committerAlex Crichton <alex@alexcrichton.com>
Mon, 27 Apr 2015 17:11:15 +0000 (10:11 -0700)
Add the ability to ignore a test based on the environment of the triple being
used.

src/compiletest/header.rs
src/compiletest/util.rs

index f5505b6e83a6738dd073b68513a4ef5755a339e4..a648e51497e79dbcc726065863d61807733a50fd 100644 (file)
@@ -170,6 +170,9 @@ fn ignore_stage(config: &Config) -> String {
         format!("ignore-{}",
                 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 {
         if config.mode != common::DebugInfoGdb {
             return false;
@@ -231,6 +234,7 @@ fn ignore_lldb(config: &Config, line: &str) -> bool {
         !parse_name_directive(ln, &ignore_target(config)) &&
         !parse_name_directive(ln, &ignore_architecture(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.target != config.host && parse_name_directive(ln, "ignore-cross-compile")) &&
         !ignore_gdb(config, ln) &&
index a8b26cb3ef76835a5fb498ca76a347eabcfee5e8..184d62db45114682d21ffe8303424c89e7f5405e 100644 (file)
@@ -60,6 +60,10 @@ 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 make_new_path(path: &str) -> String {
     assert!(cfg!(windows));
     // Windows just uses PATH as the library search path, so we have to