Skip to content

Commit 681ea93

Browse files
committed
Enable uv pipe tests on windows
Turns out the pipe names must have special names on windows. Once we have special names, all the tests pass just fine. Closes #10386
1 parent b5e602a commit 681ea93

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

src/librustuv/pipe.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,6 @@ mod tests {
251251
use super::super::local_loop;
252252

253253
#[test]
254-
#[ignore(cfg(windows))] // FIXME(#10386): how windows pipes work
255254
fn connect_err() {
256255
match PipeWatcher::connect(local_loop(), &"path/to/nowhere".to_c_str()) {
257256
Ok(*) => fail!(),
@@ -260,7 +259,6 @@ mod tests {
260259
}
261260

262261
#[test]
263-
#[ignore(cfg(windows))] // FIXME(#10386): how windows pipes work
264262
fn bind_err() {
265263
match PipeListener::bind(local_loop(), &"path/to/nowhere".to_c_str()) {
266264
Ok(*) => fail!(),
@@ -269,7 +267,6 @@ mod tests {
269267
}
270268

271269
#[test]
272-
#[ignore(cfg(windows))] // FIXME(#10386): how windows pipes work
273270
fn bind() {
274271
let p = next_test_unix().to_c_str();
275272
match PipeListener::bind(local_loop(), &p) {
@@ -279,15 +276,13 @@ mod tests {
279276
}
280277

281278
#[test] #[should_fail]
282-
#[ignore(cfg(windows))] // FIXME(#10386): how windows pipes work
283279
fn bind_fail() {
284280
let p = next_test_unix().to_c_str();
285281
let _w = PipeListener::bind(local_loop(), &p).unwrap();
286282
fail!();
287283
}
288284

289285
#[test]
290-
#[ignore(cfg(windows))] // FIXME(#10386): how windows pipes work
291286
fn connect() {
292287
let path = next_test_unix();
293288
let path2 = path.clone();
@@ -313,7 +308,6 @@ mod tests {
313308
}
314309

315310
#[test] #[should_fail]
316-
#[ignore(cfg(windows))] // FIXME(#10386): how windows pipes work
317311
fn connect_fail() {
318312
let path = next_test_unix();
319313
let path2 = path.clone();

src/libstd/rt/test.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,11 @@ pub fn next_test_port() -> u16 {
375375
/// Get a temporary path which could be the location of a unix socket
376376
#[fixed_stack_segment] #[inline(never)]
377377
pub fn next_test_unix() -> Path {
378-
os::tmpdir().join(rand::task_rng().gen_ascii_str(20))
378+
if cfg!(unix) {
379+
os::tmpdir().join(rand::task_rng().gen_ascii_str(20))
380+
} else {
381+
Path::new(r"\\.\pipe\" + rand::task_rng().gen_ascii_str(20))
382+
}
379383
}
380384

381385
/// Get a unique IPv4 localhost:port pair starting at 9600

0 commit comments

Comments
 (0)