about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorEd Schouten <ed@nuxi.nl>2018-01-11 11:20:50 +0100
committerEd Schouten <ed@nuxi.nl>2018-01-11 11:28:34 +0100
commitd9d97c9f090bfaa6a90b752455769ec12cb227f7 (patch)
tree319fcb499fd60bfa1f9bd67df7592700425889c4 /src/libstd
parentd882bb516e0998d7f9c2d049dcc618992a1a04c0 (diff)
downloadrust-d9d97c9f090bfaa6a90b752455769ec12cb227f7.tar.gz
rust-d9d97c9f090bfaa6a90b752455769ec12cb227f7.zip
Make tests build on CloudABI.
There are some tests that need to be disabled on CloudABI specifically,
due to the fact that the shims cannot be built in combination with
unix::ext or windows::ext. Also improve the scoping of some imports to
suppress compiler warnings.
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/env.rs11
-rw-r--r--src/libstd/fs.rs2
-rw-r--r--src/libstd/net/tcp.rs2
-rw-r--r--src/libstd/net/udp.rs2
-rw-r--r--src/libstd/process.rs2
5 files changed, 13 insertions, 6 deletions
diff --git a/src/libstd/env.rs b/src/libstd/env.rs
index ed34c1204b3..27bf326631f 100644
--- a/src/libstd/env.rs
+++ b/src/libstd/env.rs
@@ -956,8 +956,7 @@ mod arch {
 mod tests {
     use super::*;
 
-    use ffi::OsStr;
-    use path::{Path, PathBuf};
+    use path::Path;
 
     #[test]
     #[cfg_attr(target_os = "emscripten", ignore)]
@@ -980,6 +979,8 @@ mod tests {
     #[test]
     #[cfg(windows)]
     fn split_paths_windows() {
+        use path::PathBuf;
+
         fn check_parse(unparsed: &str, parsed: &[&str]) -> bool {
             split_paths(unparsed).collect::<Vec<_>>() ==
                 parsed.iter().map(|s| PathBuf::from(*s)).collect::<Vec<_>>()
@@ -1000,6 +1001,8 @@ mod tests {
     #[test]
     #[cfg(unix)]
     fn split_paths_unix() {
+        use path::PathBuf;
+
         fn check_parse(unparsed: &str, parsed: &[&str]) -> bool {
             split_paths(unparsed).collect::<Vec<_>>() ==
                 parsed.iter().map(|s| PathBuf::from(*s)).collect::<Vec<_>>()
@@ -1015,6 +1018,8 @@ mod tests {
     #[test]
     #[cfg(unix)]
     fn join_paths_unix() {
+        use ffi::OsStr;
+
         fn test_eq(input: &[&str], output: &str) -> bool {
             &*join_paths(input.iter().cloned()).unwrap() ==
                 OsStr::new(output)
@@ -1031,6 +1036,8 @@ mod tests {
     #[test]
     #[cfg(windows)]
     fn join_paths_windows() {
+        use ffi::OsStr;
+
         fn test_eq(input: &[&str], output: &str) -> bool {
             &*join_paths(input.iter().cloned()).unwrap() ==
                 OsStr::new(output)
diff --git a/src/libstd/fs.rs b/src/libstd/fs.rs
index f40aed2478a..82ba1a8774c 100644
--- a/src/libstd/fs.rs
+++ b/src/libstd/fs.rs
@@ -1981,7 +1981,7 @@ impl AsInnerMut<fs_imp::DirBuilder> for DirBuilder {
     }
 }
 
-#[cfg(all(test, not(target_os = "emscripten")))]
+#[cfg(all(test, not(any(target_os = "cloudabi", target_os = "emscripten"))))]
 mod tests {
     use io::prelude::*;
 
diff --git a/src/libstd/net/tcp.rs b/src/libstd/net/tcp.rs
index 539ff1df187..78235ea1b4b 100644
--- a/src/libstd/net/tcp.rs
+++ b/src/libstd/net/tcp.rs
@@ -885,7 +885,7 @@ impl fmt::Debug for TcpListener {
     }
 }
 
-#[cfg(all(test, not(target_os = "emscripten")))]
+#[cfg(all(test, not(any(target_os = "cloudabi", target_os = "emscripten"))))]
 mod tests {
     use io::ErrorKind;
     use io::prelude::*;
diff --git a/src/libstd/net/udp.rs b/src/libstd/net/udp.rs
index 84ceaa65951..fc7f9205d06 100644
--- a/src/libstd/net/udp.rs
+++ b/src/libstd/net/udp.rs
@@ -786,7 +786,7 @@ impl fmt::Debug for UdpSocket {
     }
 }
 
-#[cfg(all(test, not(target_os = "emscripten")))]
+#[cfg(all(test, not(any(target_os = "cloudabi", target_os = "emscripten"))))]
 mod tests {
     use io::ErrorKind;
     use net::*;
diff --git a/src/libstd/process.rs b/src/libstd/process.rs
index 33e8a87a0b6..5c66ac6ddde 100644
--- a/src/libstd/process.rs
+++ b/src/libstd/process.rs
@@ -1392,7 +1392,7 @@ pub fn id() -> u32 {
     ::sys::os::getpid()
 }
 
-#[cfg(all(test, not(target_os = "emscripten")))]
+#[cfg(all(test, not(any(target_os = "cloudabi", target_os = "emscripten"))))]
 mod tests {
     use io::prelude::*;