File tree Expand file tree Collapse file tree 2 files changed +23
-4
lines changed Expand file tree Collapse file tree 2 files changed +23
-4
lines changed Original file line number Diff line number Diff line change 1010
1111use common:: config;
1212use common;
13+ use util;
1314
1415use std:: io;
15- use std:: os;
1616
1717pub struct TestProps {
1818 // Lines that should be expected, in order, on standard out
@@ -89,13 +89,13 @@ pub fn load_props(testfile: &Path) -> TestProps {
8989}
9090
9191pub fn is_test_ignored ( config : & config , testfile : & Path ) -> bool {
92- fn xfail_target ( ) -> ~str {
93- ~"xfail-" + os::SYSNAME
92+ fn xfail_target ( config : & config ) -> ~str {
93+ ~"xfail-" + util::get_os(config.target)
9494 }
9595
9696 let val = do iter_header(testfile) |ln| {
9797 if parse_name_directive(ln, " xfail-test ") { false }
98- else if parse_name_directive ( ln, xfail_target ( ) ) { false }
98+ else if parse_name_directive ( ln, xfail_target ( config ) ) { false }
9999 else if config. mode == common:: mode_pretty &&
100100 parse_name_directive ( ln, "xfail-pretty" ) { false }
101101 else { true }
Original file line number Diff line number Diff line change @@ -13,6 +13,25 @@ use common::config;
1313use std:: io;
1414use std:: os:: getenv;
1515
16+ /// Conversion table from triple OS name to Rust SYSNAME
17+ static OS_TABLE : & ' static [ ( & ' static str , & ' static str ) ] = & [
18+ ( "mingw32" , "win32" ) ,
19+ ( "win32" , "win32" ) ,
20+ ( "darwin" , "macos" ) ,
21+ ( "android" , "android" ) ,
22+ ( "linux" , "linux" ) ,
23+ ( "freebsd" , "freebsd" ) ,
24+ ] ;
25+
26+ pub fn get_os ( triple : & str ) -> & ' static str {
27+ for & ( triple_os, os) in OS_TABLE . iter ( ) {
28+ if triple. contains ( triple_os) {
29+ return os
30+ }
31+ }
32+ fail ! ( "Cannot determine OS from triple" ) ;
33+ }
34+
1635pub fn make_new_path ( path : & str ) -> ~str {
1736
1837 // Windows just uses PATH as the library search path, so we have to
You can’t perform that action at this time.
0 commit comments