File tree 2 files changed +23
-4
lines changed
2 files changed +23
-4
lines changed Original file line number Diff line number Diff line change 10
10
11
11
use common:: config;
12
12
use common;
13
+ use util;
13
14
14
15
use std:: io;
15
- use std:: os;
16
16
17
17
pub struct TestProps {
18
18
// Lines that should be expected, in order, on standard out
@@ -89,13 +89,13 @@ pub fn load_props(testfile: &Path) -> TestProps {
89
89
}
90
90
91
91
pub 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)
94
94
}
95
95
96
96
let val = do iter_header(testfile) |ln| {
97
97
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 }
99
99
else if config. mode == common:: mode_pretty &&
100
100
parse_name_directive ( ln, "xfail-pretty" ) { false }
101
101
else { true }
Original file line number Diff line number Diff line change @@ -13,6 +13,25 @@ use common::config;
13
13
use std:: io;
14
14
use std:: os:: getenv;
15
15
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
+
16
35
pub fn make_new_path ( path : & str ) -> ~str {
17
36
18
37
// 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