about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2013-11-11 07:46:18 -0800
committerbors <bors@rust-lang.org>2013-11-11 07:46:18 -0800
commit4059b5c4b3b8a57a645982b0770d25f0283dfb06 (patch)
treefb6eb6744e432d122422bdf4265d62bdf65b5341
parentc47986b6751400ef30fa165d0278ec3fa212d54d (diff)
parent681ea93d52dd74a5626b9b9d714dd264b0d7ebc7 (diff)
downloadrust-4059b5c4b3b8a57a645982b0770d25f0283dfb06.tar.gz
rust-4059b5c4b3b8a57a645982b0770d25f0283dfb06.zip
auto merge of #10409 : alexcrichton/rust/issue-10386, r=brson
Turns out the pipe names must have special names on windows. Once we have
special names, all the tests pass just fine.

Closes #10386
-rw-r--r--src/librustuv/pipe.rs6
-rw-r--r--src/libstd/rt/test.rs6
2 files changed, 5 insertions, 7 deletions
diff --git a/src/librustuv/pipe.rs b/src/librustuv/pipe.rs
index c123f916ef2..1b0f352dc4d 100644
--- a/src/librustuv/pipe.rs
+++ b/src/librustuv/pipe.rs
@@ -251,7 +251,6 @@ mod tests {
     use super::super::local_loop;
 
     #[test]
-    #[ignore(cfg(windows))] // FIXME(#10386): how windows pipes work
     fn connect_err() {
         match PipeWatcher::connect(local_loop(), &"path/to/nowhere".to_c_str()) {
             Ok(*) => fail!(),
@@ -260,7 +259,6 @@ mod tests {
     }
 
     #[test]
-    #[ignore(cfg(windows))] // FIXME(#10386): how windows pipes work
     fn bind_err() {
         match PipeListener::bind(local_loop(), &"path/to/nowhere".to_c_str()) {
             Ok(*) => fail!(),
@@ -269,7 +267,6 @@ mod tests {
     }
 
     #[test]
-    #[ignore(cfg(windows))] // FIXME(#10386): how windows pipes work
     fn bind() {
         let p = next_test_unix().to_c_str();
         match PipeListener::bind(local_loop(), &p) {
@@ -279,7 +276,6 @@ mod tests {
     }
 
     #[test] #[should_fail]
-    #[ignore(cfg(windows))] // FIXME(#10386): how windows pipes work
     fn bind_fail() {
         let p = next_test_unix().to_c_str();
         let _w = PipeListener::bind(local_loop(), &p).unwrap();
@@ -287,7 +283,6 @@ mod tests {
     }
 
     #[test]
-    #[ignore(cfg(windows))] // FIXME(#10386): how windows pipes work
     fn connect() {
         let path = next_test_unix();
         let path2 = path.clone();
@@ -313,7 +308,6 @@ mod tests {
     }
 
     #[test] #[should_fail]
-    #[ignore(cfg(windows))] // FIXME(#10386): how windows pipes work
     fn connect_fail() {
         let path = next_test_unix();
         let path2 = path.clone();
diff --git a/src/libstd/rt/test.rs b/src/libstd/rt/test.rs
index 55a8db89d3c..aa680cddf2a 100644
--- a/src/libstd/rt/test.rs
+++ b/src/libstd/rt/test.rs
@@ -375,7 +375,11 @@ pub fn next_test_port() -> u16 {
 /// Get a temporary path which could be the location of a unix socket
 #[fixed_stack_segment] #[inline(never)]
 pub fn next_test_unix() -> Path {
-    os::tmpdir().join(rand::task_rng().gen_ascii_str(20))
+    if cfg!(unix) {
+        os::tmpdir().join(rand::task_rng().gen_ascii_str(20))
+    } else {
+        Path::new(r"\\.\pipe\" + rand::task_rng().gen_ascii_str(20))
+    }
 }
 
 /// Get a unique IPv4 localhost:port pair starting at 9600