Skip to content

Commit 6d1bd4b

Browse files
committed
---
yaml --- r: 170329 b: refs/heads/auto c: ac0607a h: refs/heads/master i: 170327: cfcbe76 v: v3
1 parent 0768c10 commit 6d1bd4b

File tree

2 files changed

+22
-9
lines changed

2 files changed

+22
-9
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1010
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1111
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1212
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
13-
refs/heads/auto: 1fb91dc1c2a34e5cbe384493616254253c821e41
13+
refs/heads/auto: ac0607acb27ed8ad3852a6e099ff0766b002f40e
1414
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1515
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1616
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/src/libstd/io/test.rs

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,23 +23,36 @@ pub fn next_test_port() -> u16 {
2323
base_port() + NEXT_OFFSET.fetch_add(1, Ordering::Relaxed) as u16
2424
}
2525

26-
/// Get a temporary path which could be the location of a unix socket
27-
pub fn next_test_unix() -> Path {
26+
// iOS has a pretty long tmpdir path which causes pipe creation
27+
// to like: invalid argument: path must be smaller than SUN_LEN
28+
fn next_test_unix_socket() -> String {
2829
static COUNT: AtomicUint = ATOMIC_UINT_INIT;
2930
// base port and pid are an attempt to be unique between multiple
3031
// test-runners of different configurations running on one
3132
// buildbot, the count is to be unique within this executable.
32-
let string = format!("rust-test-unix-path-{}-{}-{}",
33-
base_port(),
34-
unsafe {libc::getpid()},
35-
COUNT.fetch_add(1, Ordering::Relaxed));
33+
format!("rust-test-unix-path-{}-{}-{}",
34+
base_port(),
35+
unsafe {libc::getpid()},
36+
COUNT.fetch_add(1, Ordering::Relaxed))
37+
}
38+
39+
/// Get a temporary path which could be the location of a unix socket
40+
#[cfg(not(target_os = "ios"))]
41+
pub fn next_test_unix() -> Path {
42+
let string = next_test_unix_socket();
3643
if cfg!(unix) {
3744
os::tmpdir().join(string)
3845
} else {
3946
Path::new(format!("{}{}", r"\\.\pipe\", string))
4047
}
4148
}
4249

50+
/// Get a temporary path which could be the location of a unix socket
51+
#[cfg(target_os = "ios")]
52+
pub fn next_test_unix() -> Path {
53+
Path::new(format!("/var/tmp/{}", next_test_unix_socket()))
54+
}
55+
4356
/// Get a unique IPv4 localhost:port pair starting at 9600
4457
pub fn next_test_ip4() -> SocketAddr {
4558
SocketAddr { ip: Ipv4Addr(127, 0, 0, 1), port: next_test_port() }
@@ -99,7 +112,7 @@ pub fn raise_fd_limit() {
99112
/// multithreaded scheduler testing, depending on the number of cores available.
100113
///
101114
/// This fixes issue #7772.
102-
#[cfg(target_os="macos")]
115+
#[cfg(any(target_os = "macos", target_os = "ios"))]
103116
#[allow(non_camel_case_types)]
104117
mod darwin_fd_limit {
105118
use libc;
@@ -156,7 +169,7 @@ mod darwin_fd_limit {
156169
}
157170
}
158171

159-
#[cfg(not(target_os="macos"))]
172+
#[cfg(not(any(target_os = "macos", target_os = "ios")))]
160173
mod darwin_fd_limit {
161174
pub unsafe fn raise_fd_limit() {}
162175
}

0 commit comments

Comments
 (0)