]> git.lizzy.rs Git - rust.git/commitdiff
Ignore various entire test modules on emscripten
authorBrian Anderson <banderson@mozilla.com>
Thu, 22 Sep 2016 20:04:48 +0000 (20:04 +0000)
committerBrian Anderson <banderson@mozilla.com>
Fri, 30 Sep 2016 21:02:56 +0000 (14:02 -0700)
12 files changed:
src/libstd/fs.rs
src/libstd/net/addr.rs
src/libstd/sync/mpsc/mpsc_queue.rs
src/libstd/sync/mpsc/spsc_queue.rs
src/libstd/sync/mutex.rs
src/libstd/sync/once.rs
src/libstd/sync/rwlock.rs
src/libstd/sys/common/io.rs
src/libstd/sys/common/remutex.rs
src/libstd/sys/unix/ext/net.rs
src/libstd/thread/local.rs
src/libstd/thread/mod.rs

index 08d71c1d9f8c9dba9052b0f65faae9908db1e78b..2f2969b110db17a7687b81802ce6409013526277 100644 (file)
@@ -1686,7 +1686,7 @@ fn as_inner_mut(&mut self) -> &mut fs_imp::DirBuilder {
     }
 }
 
-#[cfg(test)]
+#[cfg(all(test, not(target_os = "emscripten")))]
 mod tests {
     use io::prelude::*;
 
@@ -1745,7 +1745,6 @@ pub fn got_symlink_permission(tmpdir: &TempDir) -> bool {
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn file_test_io_smoke_test() {
         let message = "it's alright. have a good time";
         let tmpdir = tmpdir();
@@ -1767,7 +1766,6 @@ fn file_test_io_smoke_test() {
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn invalid_path_raises() {
         let tmpdir = tmpdir();
         let filename = &tmpdir.join("file_that_does_not_exist.txt");
@@ -1782,7 +1780,6 @@ fn invalid_path_raises() {
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn file_test_iounlinking_invalid_path_should_raise_condition() {
         let tmpdir = tmpdir();
         let filename = &tmpdir.join("file_another_file_that_does_not_exist.txt");
@@ -1798,7 +1795,6 @@ fn file_test_iounlinking_invalid_path_should_raise_condition() {
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn file_test_io_non_positional_read() {
         let message: &str = "ten-four";
         let mut read_mem = [0; 8];
@@ -1825,7 +1821,6 @@ fn file_test_io_non_positional_read() {
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn file_test_io_seek_and_tell_smoke_test() {
         let message = "ten-four";
         let mut read_mem = [0; 4];
@@ -1853,7 +1848,6 @@ fn file_test_io_seek_and_tell_smoke_test() {
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn file_test_io_seek_and_write() {
         let initial_msg =   "food-is-yummy";
         let overwrite_msg =    "-the-bar!!";
@@ -1878,7 +1872,6 @@ fn file_test_io_seek_and_write() {
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn file_test_io_seek_shakedown() {
         //                   01234567890123
         let initial_msg =   "qwer-asdf-zxcv";
@@ -1911,7 +1904,6 @@ fn file_test_io_seek_shakedown() {
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn file_test_stat_is_correct_on_is_file() {
         let tmpdir = tmpdir();
         let filename = &tmpdir.join("file_stat_correct_on_is_file.txt");
@@ -1933,7 +1925,6 @@ fn file_test_stat_is_correct_on_is_file() {
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn file_test_stat_is_correct_on_is_dir() {
         let tmpdir = tmpdir();
         let filename = &tmpdir.join("file_stat_correct_on_is_dir");
@@ -1946,7 +1937,6 @@ fn file_test_stat_is_correct_on_is_dir() {
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn file_test_fileinfo_false_when_checking_is_file_on_a_directory() {
         let tmpdir = tmpdir();
         let dir = &tmpdir.join("fileinfo_false_on_dir");
@@ -1956,7 +1946,6 @@ fn file_test_fileinfo_false_when_checking_is_file_on_a_directory() {
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn file_test_fileinfo_check_exists_before_and_after_file_creation() {
         let tmpdir = tmpdir();
         let file = &tmpdir.join("fileinfo_check_exists_b_and_a.txt");
@@ -1967,7 +1956,6 @@ fn file_test_fileinfo_check_exists_before_and_after_file_creation() {
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn file_test_directoryinfo_check_exists_before_and_after_mkdir() {
         let tmpdir = tmpdir();
         let dir = &tmpdir.join("before_and_after_dir");
@@ -1980,7 +1968,6 @@ fn file_test_directoryinfo_check_exists_before_and_after_mkdir() {
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn file_test_directoryinfo_readdir() {
         let tmpdir = tmpdir();
         let dir = &tmpdir.join("di_readdir");
@@ -2010,7 +1997,6 @@ fn file_test_directoryinfo_readdir() {
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn file_create_new_already_exists_error() {
         let tmpdir = tmpdir();
         let file = &tmpdir.join("file_create_new_error_exists");
@@ -2020,7 +2006,6 @@ fn file_create_new_already_exists_error() {
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn mkdir_path_already_exists_error() {
         let tmpdir = tmpdir();
         let dir = &tmpdir.join("mkdir_error_twice");
@@ -2030,7 +2015,6 @@ fn mkdir_path_already_exists_error() {
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn recursive_mkdir() {
         let tmpdir = tmpdir();
         let dir = tmpdir.join("d1/d2");
@@ -2039,7 +2023,6 @@ fn recursive_mkdir() {
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn recursive_mkdir_failure() {
         let tmpdir = tmpdir();
         let dir = tmpdir.join("d1");
@@ -2054,13 +2037,11 @@ fn recursive_mkdir_failure() {
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn recursive_mkdir_slash() {
         check!(fs::create_dir_all(&Path::new("/")));
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn recursive_rmdir() {
         let tmpdir = tmpdir();
         let d1 = tmpdir.join("d1");
@@ -2080,7 +2061,6 @@ fn recursive_rmdir() {
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn recursive_rmdir_of_symlink() {
         // test we do not recursively delete a symlink but only dirs.
         let tmpdir = tmpdir();
@@ -2114,7 +2094,6 @@ fn recursive_rmdir_of_file_symlink() {
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn unicode_path_is_dir() {
         assert!(Path::new(".").is_dir());
         assert!(!Path::new("test/stdtest/fs.rs").is_dir());
@@ -2134,7 +2113,6 @@ fn unicode_path_is_dir() {
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn unicode_path_exists() {
         assert!(Path::new(".").exists());
         assert!(!Path::new("test/nonexistent-bogus-path").exists());
@@ -2148,7 +2126,6 @@ fn unicode_path_exists() {
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn copy_file_does_not_exist() {
         let from = Path::new("test/nonexistent-bogus-path");
         let to = Path::new("test/other-bogus-path");
@@ -2163,7 +2140,6 @@ fn copy_file_does_not_exist() {
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn copy_src_does_not_exist() {
         let tmpdir = tmpdir();
         let from = Path::new("test/nonexistent-bogus-path");
@@ -2177,7 +2153,6 @@ fn copy_src_does_not_exist() {
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn copy_file_ok() {
         let tmpdir = tmpdir();
         let input = tmpdir.join("in.txt");
@@ -2194,7 +2169,6 @@ fn copy_file_ok() {
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn copy_file_dst_dir() {
         let tmpdir = tmpdir();
         let out = tmpdir.join("out");
@@ -2206,7 +2180,6 @@ fn copy_file_dst_dir() {
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn copy_file_dst_exists() {
         let tmpdir = tmpdir();
         let input = tmpdir.join("in");
@@ -2222,7 +2195,6 @@ fn copy_file_dst_exists() {
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn copy_file_src_dir() {
         let tmpdir = tmpdir();
         let out = tmpdir.join("out");
@@ -2234,7 +2206,6 @@ fn copy_file_src_dir() {
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn copy_file_preserves_perm_bits() {
         let tmpdir = tmpdir();
         let input = tmpdir.join("in.txt");
@@ -2263,7 +2234,6 @@ fn copy_file_preserves_streams() {
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn symlinks_work() {
         let tmpdir = tmpdir();
         if !got_symlink_permission(&tmpdir) { return };
@@ -2282,7 +2252,6 @@ fn symlinks_work() {
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn symlink_noexist() {
         // Symlinks can point to things that don't exist
         let tmpdir = tmpdir();
@@ -2296,7 +2265,6 @@ fn symlink_noexist() {
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn read_link() {
         if cfg!(windows) {
             // directory symlink
@@ -2317,7 +2285,6 @@ fn read_link() {
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn readlink_not_symlink() {
         let tmpdir = tmpdir();
         match fs::read_link(tmpdir.path()) {
@@ -2327,7 +2294,6 @@ fn readlink_not_symlink() {
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn links_work() {
         let tmpdir = tmpdir();
         let input = tmpdir.join("in.txt");
@@ -2356,7 +2322,6 @@ fn links_work() {
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn chmod_works() {
         let tmpdir = tmpdir();
         let file = tmpdir.join("in.txt");
@@ -2380,7 +2345,6 @@ fn chmod_works() {
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn sync_doesnt_kill_anything() {
         let tmpdir = tmpdir();
         let path = tmpdir.join("in.txt");
@@ -2394,7 +2358,6 @@ fn sync_doesnt_kill_anything() {
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn truncate_works() {
         let tmpdir = tmpdir();
         let path = tmpdir.join("in.txt");
@@ -2429,7 +2392,6 @@ fn truncate_works() {
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn open_flavors() {
         use fs::OpenOptions as OO;
         fn c<T: Clone>(t: &T) -> T { t.clone() }
@@ -2549,7 +2511,6 @@ fn _assert_send_sync<T: Send + Sync>() {}
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn binary_file() {
         let mut bytes = [0; 1024];
         StdRng::new().unwrap().fill_bytes(&mut bytes);
@@ -2563,7 +2524,6 @@ fn binary_file() {
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn file_try_clone() {
         let tmpdir = tmpdir();
 
@@ -2586,7 +2546,6 @@ fn file_try_clone() {
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     #[cfg(not(windows))]
     fn unlink_readonly() {
         let tmpdir = tmpdir();
@@ -2599,7 +2558,6 @@ fn unlink_readonly() {
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn mkdir_trailing_slash() {
         let tmpdir = tmpdir();
         let path = tmpdir.join("file");
@@ -2607,7 +2565,6 @@ fn mkdir_trailing_slash() {
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn canonicalize_works_simple() {
         let tmpdir = tmpdir();
         let tmpdir = fs::canonicalize(tmpdir.path()).unwrap();
@@ -2617,7 +2574,6 @@ fn canonicalize_works_simple() {
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn realpath_works() {
         let tmpdir = tmpdir();
         if !got_symlink_permission(&tmpdir) { return };
@@ -2643,7 +2599,6 @@ fn realpath_works() {
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn realpath_works_tricky() {
         let tmpdir = tmpdir();
         if !got_symlink_permission(&tmpdir) { return };
@@ -2673,7 +2628,6 @@ fn realpath_works_tricky() {
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn dir_entry_methods() {
         let tmpdir = tmpdir();
 
@@ -2708,14 +2662,12 @@ fn dir_entry_debug() {
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn read_dir_not_found() {
         let res = fs::read_dir("/path/that/does/not/exist");
         assert_eq!(res.err().unwrap().kind(), ErrorKind::NotFound);
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn create_dir_all_with_junctions() {
         let tmpdir = tmpdir();
         let target = tmpdir.join("target");
@@ -2743,7 +2695,6 @@ fn create_dir_all_with_junctions() {
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn metadata_access_times() {
         let tmpdir = tmpdir();
 
index a77d83a23ce73d12fbba3510eac555a7face9e11..58daa7dbf8dc4d843b9b5e49f2da0f860d0e85f8 100644 (file)
@@ -533,7 +533,6 @@ fn to_socket_addr_ipaddr_u16() {
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn to_socket_addr_str_u16() {
         let a = sa4(Ipv4Addr::new(77, 88, 21, 11), 24352);
         assert_eq!(Ok(vec![a]), tsa(("77.88.21.11", 24352)));
@@ -546,7 +545,6 @@ fn to_socket_addr_str_u16() {
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn to_socket_addr_str() {
         let a = sa4(Ipv4Addr::new(77, 88, 21, 11), 24352);
         assert_eq!(Ok(vec![a]), tsa("77.88.21.11:24352"));
@@ -561,7 +559,6 @@ fn to_socket_addr_str() {
     // FIXME: figure out why this fails on openbsd and bitrig and fix it
     #[test]
     #[cfg(not(any(windows, target_os = "openbsd", target_os = "bitrig")))]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn to_socket_addr_str_bad() {
         assert!(tsa("1200::AB00:1234::2552:7777:1313:34300").is_err());
     }
index 2ff9ffe6d0810340e7cc046c2faa34bd6fa6af3b..8d80f942ff75cb9f50c29919c75d7beaf6a21466 100644 (file)
@@ -146,7 +146,7 @@ fn drop(&mut self) {
     }
 }
 
-#[cfg(test)]
+#[cfg(all(test, not(target_os = "emscripten")))]
 mod tests {
     use sync::mpsc::channel;
     use super::{Queue, Data, Empty, Inconsistent};
@@ -161,7 +161,6 @@ fn test_full() {
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn test() {
         let nthreads = 8;
         let nmsgs = 1000;
index cb9577f155ea1c389fdcbb9f9848fd8255bd8852..5858e4b6ddb1f2ab35312aaa4a5406baa84ca29c 100644 (file)
@@ -231,7 +231,7 @@ fn drop(&mut self) {
     }
 }
 
-#[cfg(test)]
+#[cfg(all(test, not(target_os = "emscripten")))]
 mod tests {
     use sync::Arc;
     use super::Queue;
@@ -305,7 +305,6 @@ fn smoke_bound() {
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn stress() {
         unsafe {
             stress_bound(0);
index 07d60f0610f8cb1f787182992b595f5e3eb85d94..812724c7a167eaf13e61801d079dd421222c9315 100644 (file)
@@ -352,7 +352,7 @@ pub fn guard_poison<'a, T: ?Sized>(guard: &MutexGuard<'a, T>) -> &'a poison::Fla
     &guard.__lock.poison
 }
 
-#[cfg(test)]
+#[cfg(all(test, not(target_os = "emscripten")))]
 mod tests {
     use sync::mpsc::channel;
     use sync::{Arc, Mutex, Condvar};
@@ -375,7 +375,6 @@ fn smoke() {
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn lots_and_lots() {
         const J: u32 = 1000;
         const K: u32 = 3;
@@ -436,7 +435,6 @@ fn drop(&mut self) {
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn test_into_inner_poison() {
         let m = Arc::new(Mutex::new(NonCopy(10)));
         let m2 = m.clone();
@@ -460,7 +458,6 @@ fn test_get_mut() {
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn test_get_mut_poison() {
         let m = Arc::new(Mutex::new(NonCopy(10)));
         let m2 = m.clone();
@@ -477,7 +474,6 @@ fn test_get_mut_poison() {
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn test_mutex_arc_condvar() {
         let packet = Packet(Arc::new((Mutex::new(false), Condvar::new())));
         let packet2 = Packet(packet.0.clone());
@@ -501,7 +497,6 @@ fn test_mutex_arc_condvar() {
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn test_arc_condvar_poison() {
         let packet = Packet(Arc::new((Mutex::new(1), Condvar::new())));
         let packet2 = Packet(packet.0.clone());
@@ -531,7 +526,6 @@ fn test_arc_condvar_poison() {
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn test_mutex_arc_poison() {
         let arc = Arc::new(Mutex::new(1));
         assert!(!arc.is_poisoned());
@@ -545,7 +539,6 @@ fn test_mutex_arc_poison() {
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn test_mutex_arc_nested() {
         // Tests nested mutexes and access
         // to underlying data.
@@ -562,7 +555,6 @@ fn test_mutex_arc_nested() {
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn test_mutex_arc_access_in_unwind() {
         let arc = Arc::new(Mutex::new(1));
         let arc2 = arc.clone();
index 64c3e2bb42f499e06df1a0c60cc7e4b8f2122383..ad9d0b375442200be9ecf0cf59fb04d64dcfdd44 100644 (file)
@@ -367,7 +367,7 @@ pub fn poisoned(&self) -> bool {
     }
 }
 
-#[cfg(test)]
+#[cfg(all(test, not(target_os = "emscripten")))]
 mod tests {
     use panic;
     use sync::mpsc::channel;
@@ -385,7 +385,6 @@ fn smoke_once() {
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn stampede_once() {
         static O: Once = Once::new();
         static mut run: bool = false;
@@ -448,7 +447,6 @@ fn poison_bad() {
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn wait_for_force_to_finish() {
         static O: Once = Once::new();
 
index cb46b694f37e561fdfb21550b88e1afb5a025164..48ecae185f95c37e9e9a54a3e24c121587bb5fcc 100644 (file)
@@ -380,7 +380,7 @@ fn drop(&mut self) {
     }
 }
 
-#[cfg(test)]
+#[cfg(all(test, not(target_os = "emscripten")))]
 mod tests {
     #![allow(deprecated)] // rand
 
@@ -403,7 +403,6 @@ fn smoke() {
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn frob() {
         const N: usize = 10;
         const M: usize = 1000;
@@ -431,7 +430,6 @@ fn frob() {
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn test_rw_arc_poison_wr() {
         let arc = Arc::new(RwLock::new(1));
         let arc2 = arc.clone();
@@ -443,7 +441,6 @@ fn test_rw_arc_poison_wr() {
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn test_rw_arc_poison_ww() {
         let arc = Arc::new(RwLock::new(1));
         assert!(!arc.is_poisoned());
@@ -457,7 +454,6 @@ fn test_rw_arc_poison_ww() {
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn test_rw_arc_no_poison_rr() {
         let arc = Arc::new(RwLock::new(1));
         let arc2 = arc.clone();
@@ -469,7 +465,6 @@ fn test_rw_arc_no_poison_rr() {
         assert_eq!(*lock, 1);
     }
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn test_rw_arc_no_poison_rw() {
         let arc = Arc::new(RwLock::new(1));
         let arc2 = arc.clone();
@@ -482,7 +477,6 @@ fn test_rw_arc_no_poison_rw() {
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn test_rw_arc() {
         let arc = Arc::new(RwLock::new(0));
         let arc2 = arc.clone();
@@ -521,7 +515,6 @@ fn test_rw_arc() {
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn test_rw_arc_access_in_unwind() {
         let arc = Arc::new(RwLock::new(1));
         let arc2 = arc.clone();
@@ -594,7 +587,6 @@ fn drop(&mut self) {
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn test_into_inner_poison() {
         let m = Arc::new(RwLock::new(NonCopy(10)));
         let m2 = m.clone();
@@ -618,7 +610,6 @@ fn test_get_mut() {
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn test_get_mut_poison() {
         let m = Arc::new(RwLock::new(NonCopy(10)));
         let m2 = m.clone();
index 2778ed9326c0783729943cfdecae4cbff72d7dca..47cec4ef5c2762a7c6e2601e28f88c84bb728974 100644 (file)
@@ -50,7 +50,7 @@ pub unsafe fn read_to_end_uninitialized(r: &mut Read, buf: &mut Vec<u8>) -> io::
     }
 }
 
-#[cfg(test)]
+#[cfg(all(test, not(target_os = "emscripten")))]
 pub mod test {
     use path::{Path, PathBuf};
     use env;
index 4935afe6afc42024e6d27090e3a0fc65c3d12005..4d0407ccf6c8903bb20eee0059b492319a94d81f 100644 (file)
@@ -156,7 +156,7 @@ fn drop(&mut self) {
 }
 
 
-#[cfg(test)]
+#[cfg(all(test, not(target_os = "emscripten")))]
 mod tests {
     use sys_common::remutex::{ReentrantMutex, ReentrantMutexGuard};
     use cell::RefCell;
@@ -181,7 +181,6 @@ fn smoke() {
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn is_mutex() {
         let m = Arc::new(ReentrantMutex::new(RefCell::new(0)));
         let m2 = m.clone();
@@ -199,7 +198,6 @@ fn is_mutex() {
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn trylock_works() {
         let m = Arc::new(ReentrantMutex::new(()));
         let m2 = m.clone();
@@ -220,7 +218,6 @@ fn drop(&mut self) {
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn poison_works() {
         let m = Arc::new(ReentrantMutex::new(RefCell::new(0)));
         let mc = m.clone();
index 8224696db2f8d516d7eee5a0b10d69f62a11f3eb..40fe24cf10e281626d97a14e6da9f540bd3a5776 100644 (file)
@@ -786,7 +786,7 @@ fn into_raw_fd(self) -> RawFd {
     }
 }
 
-#[cfg(test)]
+#[cfg(all(test, not(target_os = "emscripten")))]
 mod test {
     use thread;
     use io;
@@ -806,7 +806,6 @@ macro_rules! or_panic {
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn basic() {
         let dir = tmpdir();
         let socket_path = dir.path().join("sock");
@@ -835,7 +834,6 @@ fn basic() {
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn pair() {
         let msg1 = b"hello";
         let msg2 = b"world!";
@@ -859,7 +857,6 @@ fn pair() {
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn try_clone() {
         let dir = tmpdir();
         let socket_path = dir.path().join("sock");
@@ -886,7 +883,6 @@ fn try_clone() {
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn iter() {
         let dir = tmpdir();
         let socket_path = dir.path().join("sock");
@@ -909,7 +905,6 @@ fn iter() {
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn long_path() {
         let dir = tmpdir();
         let socket_path = dir.path()
@@ -935,7 +930,6 @@ fn long_path() {
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn timeouts() {
         let dir = tmpdir();
         let socket_path = dir.path().join("sock");
@@ -963,7 +957,6 @@ fn timeouts() {
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn test_read_timeout() {
         let dir = tmpdir();
         let socket_path = dir.path().join("sock");
@@ -979,7 +972,6 @@ fn test_read_timeout() {
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn test_read_with_timeout() {
         let dir = tmpdir();
         let socket_path = dir.path().join("sock");
@@ -1001,7 +993,6 @@ fn test_read_with_timeout() {
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn test_unix_datagram() {
         let dir = tmpdir();
         let path1 = dir.path().join("sock1");
@@ -1018,7 +1009,6 @@ fn test_unix_datagram() {
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn test_unnamed_unix_datagram() {
         let dir = tmpdir();
         let path1 = dir.path().join("sock1");
@@ -1036,7 +1026,6 @@ fn test_unnamed_unix_datagram() {
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn test_connect_unix_datagram() {
         let dir = tmpdir();
         let path1 = dir.path().join("sock1");
@@ -1063,7 +1052,6 @@ fn test_connect_unix_datagram() {
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn test_unix_datagram_recv() {
         let dir = tmpdir();
         let path1 = dir.path().join("sock1");
@@ -1081,7 +1069,6 @@ fn test_unix_datagram_recv() {
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn datagram_pair() {
         let msg1 = b"hello";
         let msg2 = b"world!";
index 59748b47d815793ec60760cd8335b5d7bf389431..a333a7d967d240fa11f757543fe50f068c529cad 100644 (file)
@@ -524,7 +524,7 @@ pub fn get(&'static self) -> Option<&'static UnsafeCell<Option<T>>> {
     }
 }
 
-#[cfg(test)]
+#[cfg(all(test, not(target_os = "emscripten")))]
 mod tests {
     use sync::mpsc::{channel, Sender};
     use cell::{Cell, UnsafeCell};
@@ -541,7 +541,6 @@ fn drop(&mut self) {
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn smoke_no_dtor() {
         thread_local!(static FOO: Cell<i32> = Cell::new(1));
 
@@ -564,7 +563,6 @@ fn smoke_no_dtor() {
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn states() {
         struct Foo;
         impl Drop for Foo {
@@ -588,7 +586,6 @@ fn foo() -> Foo {
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn smoke_dtor() {
         thread_local!(static FOO: UnsafeCell<Option<Foo>> = UnsafeCell::new(None));
 
@@ -603,7 +600,6 @@ fn smoke_dtor() {
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn circular() {
         struct S1;
         struct S2;
@@ -644,7 +640,6 @@ fn drop(&mut self) {
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn self_referential() {
         struct S1;
         thread_local!(static K1: UnsafeCell<Option<S1>> = UnsafeCell::new(None));
@@ -666,7 +661,6 @@ fn drop(&mut self) {
     // test on OSX.
     #[test]
     #[cfg_attr(target_os = "macos", ignore)]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn dtors_in_dtors_in_dtors() {
         struct S1(Sender<()>);
         thread_local!(static K1: UnsafeCell<Option<S1>> = UnsafeCell::new(None));
index b42a0fa3ac1302e6cc0bc14bcf699a38815efb51..775dfababc680939491bc81ddd1dad0d393517b7 100644 (file)
@@ -741,7 +741,7 @@ fn _assert_both<T: Send + Sync>() {}
 // Tests
 ////////////////////////////////////////////////////////////////////////////////
 
-#[cfg(test)]
+#[cfg(all(test, not(target_os = "emscripten")))]
 mod tests {
     use any::Any;
     use sync::mpsc::{channel, Sender};
@@ -755,7 +755,6 @@ mod tests {
     // !!! instead of exiting cleanly. This might wedge the buildbots.       !!!
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn test_unnamed_thread() {
         thread::spawn(move|| {
             assert!(thread::current().name().is_none());
@@ -763,7 +762,6 @@ fn test_unnamed_thread() {
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn test_named_thread() {
         Builder::new().name("ada lovelace".to_string()).spawn(move|| {
             assert!(thread::current().name().unwrap() == "ada lovelace".to_string());
@@ -772,13 +770,11 @@ fn test_named_thread() {
 
     #[test]
     #[should_panic]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn test_invalid_named_thread() {
         let _ = Builder::new().name("ada l\0velace".to_string()).spawn(|| {});
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn test_run_basic() {
         let (tx, rx) = channel();
         thread::spawn(move|| {
@@ -788,7 +784,6 @@ fn test_run_basic() {
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn test_join_panic() {
         match thread::spawn(move|| {
             panic!()
@@ -799,7 +794,6 @@ fn test_join_panic() {
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn test_spawn_sched() {
         let (tx, rx) = channel();
 
@@ -819,7 +813,6 @@ fn f(i: i32, tx: Sender<()>) {
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn test_spawn_sched_childs_on_default_sched() {
         let (tx, rx) = channel();
 
@@ -848,7 +841,6 @@ fn avoid_copying_the_body<F>(spawnfn: F) where F: FnOnce(Box<Fn() + Send>) {
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn test_avoid_copying_the_body_spawn() {
         avoid_copying_the_body(|v| {
             thread::spawn(move || v());
@@ -856,7 +848,6 @@ fn test_avoid_copying_the_body_spawn() {
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn test_avoid_copying_the_body_thread_spawn() {
         avoid_copying_the_body(|f| {
             thread::spawn(move|| {
@@ -866,7 +857,6 @@ fn test_avoid_copying_the_body_thread_spawn() {
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn test_avoid_copying_the_body_join() {
         avoid_copying_the_body(|f| {
             let _ = thread::spawn(move|| {
@@ -876,7 +866,6 @@ fn test_avoid_copying_the_body_join() {
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn test_child_doesnt_ref_parent() {
         // If the child refcounts the parent thread, this will stack overflow when
         // climbing the thread tree to dereference each ancestor. (See #1789)
@@ -894,13 +883,11 @@ fn child_no(x: u32) -> Box<Fn() + Send> {
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn test_simple_newsched_spawn() {
         thread::spawn(move || {});
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn test_try_panic_message_static_str() {
         match thread::spawn(move|| {
             panic!("static string");
@@ -915,7 +902,6 @@ fn test_try_panic_message_static_str() {
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn test_try_panic_message_owned_str() {
         match thread::spawn(move|| {
             panic!("owned string".to_string());
@@ -930,7 +916,6 @@ fn test_try_panic_message_owned_str() {
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn test_try_panic_message_any() {
         match thread::spawn(move|| {
             panic!(box 413u16 as Box<Any + Send>);
@@ -947,7 +932,6 @@ fn test_try_panic_message_any() {
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn test_try_panic_message_unit_struct() {
         struct Juju;
 
@@ -960,7 +944,6 @@ fn test_try_panic_message_unit_struct() {
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn test_park_timeout_unpark_before() {
         for _ in 0..10 {
             thread::current().unpark();
@@ -969,7 +952,6 @@ fn test_park_timeout_unpark_before() {
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn test_park_timeout_unpark_not_called() {
         for _ in 0..10 {
             thread::park_timeout(Duration::from_millis(10));
@@ -977,7 +959,6 @@ fn test_park_timeout_unpark_not_called() {
     }
 
     #[test]
-    #[cfg_attr(target_os = "emscripten", ignore)]
     fn test_park_timeout_unpark_called_other_thread() {
         for _ in 0..10 {
             let th = thread::current();