1
Fork 0

Ignore various entire test modules on emscripten

This commit is contained in:
Brian Anderson 2016-09-22 20:04:48 +00:00
parent 525a798ca6
commit 096670ca41
12 changed files with 11 additions and 125 deletions

View file

@ -1686,7 +1686,7 @@ impl AsInnerMut<fs_imp::DirBuilder> for DirBuilder {
} }
} }
#[cfg(test)] #[cfg(all(test, not(target_os = "emscripten")))]
mod tests { mod tests {
use io::prelude::*; use io::prelude::*;
@ -1745,7 +1745,6 @@ mod tests {
} }
#[test] #[test]
#[cfg_attr(target_os = "emscripten", ignore)]
fn file_test_io_smoke_test() { fn file_test_io_smoke_test() {
let message = "it's alright. have a good time"; let message = "it's alright. have a good time";
let tmpdir = tmpdir(); let tmpdir = tmpdir();
@ -1767,7 +1766,6 @@ mod tests {
} }
#[test] #[test]
#[cfg_attr(target_os = "emscripten", ignore)]
fn invalid_path_raises() { fn invalid_path_raises() {
let tmpdir = tmpdir(); let tmpdir = tmpdir();
let filename = &tmpdir.join("file_that_does_not_exist.txt"); let filename = &tmpdir.join("file_that_does_not_exist.txt");
@ -1782,7 +1780,6 @@ mod tests {
} }
#[test] #[test]
#[cfg_attr(target_os = "emscripten", ignore)]
fn file_test_iounlinking_invalid_path_should_raise_condition() { fn file_test_iounlinking_invalid_path_should_raise_condition() {
let tmpdir = tmpdir(); let tmpdir = tmpdir();
let filename = &tmpdir.join("file_another_file_that_does_not_exist.txt"); let filename = &tmpdir.join("file_another_file_that_does_not_exist.txt");
@ -1798,7 +1795,6 @@ mod tests {
} }
#[test] #[test]
#[cfg_attr(target_os = "emscripten", ignore)]
fn file_test_io_non_positional_read() { fn file_test_io_non_positional_read() {
let message: &str = "ten-four"; let message: &str = "ten-four";
let mut read_mem = [0; 8]; let mut read_mem = [0; 8];
@ -1825,7 +1821,6 @@ mod tests {
} }
#[test] #[test]
#[cfg_attr(target_os = "emscripten", ignore)]
fn file_test_io_seek_and_tell_smoke_test() { fn file_test_io_seek_and_tell_smoke_test() {
let message = "ten-four"; let message = "ten-four";
let mut read_mem = [0; 4]; let mut read_mem = [0; 4];
@ -1853,7 +1848,6 @@ mod tests {
} }
#[test] #[test]
#[cfg_attr(target_os = "emscripten", ignore)]
fn file_test_io_seek_and_write() { fn file_test_io_seek_and_write() {
let initial_msg = "food-is-yummy"; let initial_msg = "food-is-yummy";
let overwrite_msg = "-the-bar!!"; let overwrite_msg = "-the-bar!!";
@ -1878,7 +1872,6 @@ mod tests {
} }
#[test] #[test]
#[cfg_attr(target_os = "emscripten", ignore)]
fn file_test_io_seek_shakedown() { fn file_test_io_seek_shakedown() {
// 01234567890123 // 01234567890123
let initial_msg = "qwer-asdf-zxcv"; let initial_msg = "qwer-asdf-zxcv";
@ -1911,7 +1904,6 @@ mod tests {
} }
#[test] #[test]
#[cfg_attr(target_os = "emscripten", ignore)]
fn file_test_stat_is_correct_on_is_file() { fn file_test_stat_is_correct_on_is_file() {
let tmpdir = tmpdir(); let tmpdir = tmpdir();
let filename = &tmpdir.join("file_stat_correct_on_is_file.txt"); let filename = &tmpdir.join("file_stat_correct_on_is_file.txt");
@ -1933,7 +1925,6 @@ mod tests {
} }
#[test] #[test]
#[cfg_attr(target_os = "emscripten", ignore)]
fn file_test_stat_is_correct_on_is_dir() { fn file_test_stat_is_correct_on_is_dir() {
let tmpdir = tmpdir(); let tmpdir = tmpdir();
let filename = &tmpdir.join("file_stat_correct_on_is_dir"); let filename = &tmpdir.join("file_stat_correct_on_is_dir");
@ -1946,7 +1937,6 @@ mod tests {
} }
#[test] #[test]
#[cfg_attr(target_os = "emscripten", ignore)]
fn file_test_fileinfo_false_when_checking_is_file_on_a_directory() { fn file_test_fileinfo_false_when_checking_is_file_on_a_directory() {
let tmpdir = tmpdir(); let tmpdir = tmpdir();
let dir = &tmpdir.join("fileinfo_false_on_dir"); let dir = &tmpdir.join("fileinfo_false_on_dir");
@ -1956,7 +1946,6 @@ mod tests {
} }
#[test] #[test]
#[cfg_attr(target_os = "emscripten", ignore)]
fn file_test_fileinfo_check_exists_before_and_after_file_creation() { fn file_test_fileinfo_check_exists_before_and_after_file_creation() {
let tmpdir = tmpdir(); let tmpdir = tmpdir();
let file = &tmpdir.join("fileinfo_check_exists_b_and_a.txt"); let file = &tmpdir.join("fileinfo_check_exists_b_and_a.txt");
@ -1967,7 +1956,6 @@ mod tests {
} }
#[test] #[test]
#[cfg_attr(target_os = "emscripten", ignore)]
fn file_test_directoryinfo_check_exists_before_and_after_mkdir() { fn file_test_directoryinfo_check_exists_before_and_after_mkdir() {
let tmpdir = tmpdir(); let tmpdir = tmpdir();
let dir = &tmpdir.join("before_and_after_dir"); let dir = &tmpdir.join("before_and_after_dir");
@ -1980,7 +1968,6 @@ mod tests {
} }
#[test] #[test]
#[cfg_attr(target_os = "emscripten", ignore)]
fn file_test_directoryinfo_readdir() { fn file_test_directoryinfo_readdir() {
let tmpdir = tmpdir(); let tmpdir = tmpdir();
let dir = &tmpdir.join("di_readdir"); let dir = &tmpdir.join("di_readdir");
@ -2010,7 +1997,6 @@ mod tests {
} }
#[test] #[test]
#[cfg_attr(target_os = "emscripten", ignore)]
fn file_create_new_already_exists_error() { fn file_create_new_already_exists_error() {
let tmpdir = tmpdir(); let tmpdir = tmpdir();
let file = &tmpdir.join("file_create_new_error_exists"); let file = &tmpdir.join("file_create_new_error_exists");
@ -2020,7 +2006,6 @@ mod tests {
} }
#[test] #[test]
#[cfg_attr(target_os = "emscripten", ignore)]
fn mkdir_path_already_exists_error() { fn mkdir_path_already_exists_error() {
let tmpdir = tmpdir(); let tmpdir = tmpdir();
let dir = &tmpdir.join("mkdir_error_twice"); let dir = &tmpdir.join("mkdir_error_twice");
@ -2030,7 +2015,6 @@ mod tests {
} }
#[test] #[test]
#[cfg_attr(target_os = "emscripten", ignore)]
fn recursive_mkdir() { fn recursive_mkdir() {
let tmpdir = tmpdir(); let tmpdir = tmpdir();
let dir = tmpdir.join("d1/d2"); let dir = tmpdir.join("d1/d2");
@ -2039,7 +2023,6 @@ mod tests {
} }
#[test] #[test]
#[cfg_attr(target_os = "emscripten", ignore)]
fn recursive_mkdir_failure() { fn recursive_mkdir_failure() {
let tmpdir = tmpdir(); let tmpdir = tmpdir();
let dir = tmpdir.join("d1"); let dir = tmpdir.join("d1");
@ -2054,13 +2037,11 @@ mod tests {
} }
#[test] #[test]
#[cfg_attr(target_os = "emscripten", ignore)]
fn recursive_mkdir_slash() { fn recursive_mkdir_slash() {
check!(fs::create_dir_all(&Path::new("/"))); check!(fs::create_dir_all(&Path::new("/")));
} }
#[test] #[test]
#[cfg_attr(target_os = "emscripten", ignore)]
fn recursive_rmdir() { fn recursive_rmdir() {
let tmpdir = tmpdir(); let tmpdir = tmpdir();
let d1 = tmpdir.join("d1"); let d1 = tmpdir.join("d1");
@ -2080,7 +2061,6 @@ mod tests {
} }
#[test] #[test]
#[cfg_attr(target_os = "emscripten", ignore)]
fn recursive_rmdir_of_symlink() { fn recursive_rmdir_of_symlink() {
// test we do not recursively delete a symlink but only dirs. // test we do not recursively delete a symlink but only dirs.
let tmpdir = tmpdir(); let tmpdir = tmpdir();
@ -2114,7 +2094,6 @@ mod tests {
} }
#[test] #[test]
#[cfg_attr(target_os = "emscripten", ignore)]
fn unicode_path_is_dir() { fn unicode_path_is_dir() {
assert!(Path::new(".").is_dir()); assert!(Path::new(".").is_dir());
assert!(!Path::new("test/stdtest/fs.rs").is_dir()); assert!(!Path::new("test/stdtest/fs.rs").is_dir());
@ -2134,7 +2113,6 @@ mod tests {
} }
#[test] #[test]
#[cfg_attr(target_os = "emscripten", ignore)]
fn unicode_path_exists() { fn unicode_path_exists() {
assert!(Path::new(".").exists()); assert!(Path::new(".").exists());
assert!(!Path::new("test/nonexistent-bogus-path").exists()); assert!(!Path::new("test/nonexistent-bogus-path").exists());
@ -2148,7 +2126,6 @@ mod tests {
} }
#[test] #[test]
#[cfg_attr(target_os = "emscripten", ignore)]
fn copy_file_does_not_exist() { fn copy_file_does_not_exist() {
let from = Path::new("test/nonexistent-bogus-path"); let from = Path::new("test/nonexistent-bogus-path");
let to = Path::new("test/other-bogus-path"); let to = Path::new("test/other-bogus-path");
@ -2163,7 +2140,6 @@ mod tests {
} }
#[test] #[test]
#[cfg_attr(target_os = "emscripten", ignore)]
fn copy_src_does_not_exist() { fn copy_src_does_not_exist() {
let tmpdir = tmpdir(); let tmpdir = tmpdir();
let from = Path::new("test/nonexistent-bogus-path"); let from = Path::new("test/nonexistent-bogus-path");
@ -2177,7 +2153,6 @@ mod tests {
} }
#[test] #[test]
#[cfg_attr(target_os = "emscripten", ignore)]
fn copy_file_ok() { fn copy_file_ok() {
let tmpdir = tmpdir(); let tmpdir = tmpdir();
let input = tmpdir.join("in.txt"); let input = tmpdir.join("in.txt");
@ -2194,7 +2169,6 @@ mod tests {
} }
#[test] #[test]
#[cfg_attr(target_os = "emscripten", ignore)]
fn copy_file_dst_dir() { fn copy_file_dst_dir() {
let tmpdir = tmpdir(); let tmpdir = tmpdir();
let out = tmpdir.join("out"); let out = tmpdir.join("out");
@ -2206,7 +2180,6 @@ mod tests {
} }
#[test] #[test]
#[cfg_attr(target_os = "emscripten", ignore)]
fn copy_file_dst_exists() { fn copy_file_dst_exists() {
let tmpdir = tmpdir(); let tmpdir = tmpdir();
let input = tmpdir.join("in"); let input = tmpdir.join("in");
@ -2222,7 +2195,6 @@ mod tests {
} }
#[test] #[test]
#[cfg_attr(target_os = "emscripten", ignore)]
fn copy_file_src_dir() { fn copy_file_src_dir() {
let tmpdir = tmpdir(); let tmpdir = tmpdir();
let out = tmpdir.join("out"); let out = tmpdir.join("out");
@ -2234,7 +2206,6 @@ mod tests {
} }
#[test] #[test]
#[cfg_attr(target_os = "emscripten", ignore)]
fn copy_file_preserves_perm_bits() { fn copy_file_preserves_perm_bits() {
let tmpdir = tmpdir(); let tmpdir = tmpdir();
let input = tmpdir.join("in.txt"); let input = tmpdir.join("in.txt");
@ -2263,7 +2234,6 @@ mod tests {
} }
#[test] #[test]
#[cfg_attr(target_os = "emscripten", ignore)]
fn symlinks_work() { fn symlinks_work() {
let tmpdir = tmpdir(); let tmpdir = tmpdir();
if !got_symlink_permission(&tmpdir) { return }; if !got_symlink_permission(&tmpdir) { return };
@ -2282,7 +2252,6 @@ mod tests {
} }
#[test] #[test]
#[cfg_attr(target_os = "emscripten", ignore)]
fn symlink_noexist() { fn symlink_noexist() {
// Symlinks can point to things that don't exist // Symlinks can point to things that don't exist
let tmpdir = tmpdir(); let tmpdir = tmpdir();
@ -2296,7 +2265,6 @@ mod tests {
} }
#[test] #[test]
#[cfg_attr(target_os = "emscripten", ignore)]
fn read_link() { fn read_link() {
if cfg!(windows) { if cfg!(windows) {
// directory symlink // directory symlink
@ -2317,7 +2285,6 @@ mod tests {
} }
#[test] #[test]
#[cfg_attr(target_os = "emscripten", ignore)]
fn readlink_not_symlink() { fn readlink_not_symlink() {
let tmpdir = tmpdir(); let tmpdir = tmpdir();
match fs::read_link(tmpdir.path()) { match fs::read_link(tmpdir.path()) {
@ -2327,7 +2294,6 @@ mod tests {
} }
#[test] #[test]
#[cfg_attr(target_os = "emscripten", ignore)]
fn links_work() { fn links_work() {
let tmpdir = tmpdir(); let tmpdir = tmpdir();
let input = tmpdir.join("in.txt"); let input = tmpdir.join("in.txt");
@ -2356,7 +2322,6 @@ mod tests {
} }
#[test] #[test]
#[cfg_attr(target_os = "emscripten", ignore)]
fn chmod_works() { fn chmod_works() {
let tmpdir = tmpdir(); let tmpdir = tmpdir();
let file = tmpdir.join("in.txt"); let file = tmpdir.join("in.txt");
@ -2380,7 +2345,6 @@ mod tests {
} }
#[test] #[test]
#[cfg_attr(target_os = "emscripten", ignore)]
fn sync_doesnt_kill_anything() { fn sync_doesnt_kill_anything() {
let tmpdir = tmpdir(); let tmpdir = tmpdir();
let path = tmpdir.join("in.txt"); let path = tmpdir.join("in.txt");
@ -2394,7 +2358,6 @@ mod tests {
} }
#[test] #[test]
#[cfg_attr(target_os = "emscripten", ignore)]
fn truncate_works() { fn truncate_works() {
let tmpdir = tmpdir(); let tmpdir = tmpdir();
let path = tmpdir.join("in.txt"); let path = tmpdir.join("in.txt");
@ -2429,7 +2392,6 @@ mod tests {
} }
#[test] #[test]
#[cfg_attr(target_os = "emscripten", ignore)]
fn open_flavors() { fn open_flavors() {
use fs::OpenOptions as OO; use fs::OpenOptions as OO;
fn c<T: Clone>(t: &T) -> T { t.clone() } fn c<T: Clone>(t: &T) -> T { t.clone() }
@ -2549,7 +2511,6 @@ mod tests {
} }
#[test] #[test]
#[cfg_attr(target_os = "emscripten", ignore)]
fn binary_file() { fn binary_file() {
let mut bytes = [0; 1024]; let mut bytes = [0; 1024];
StdRng::new().unwrap().fill_bytes(&mut bytes); StdRng::new().unwrap().fill_bytes(&mut bytes);
@ -2563,7 +2524,6 @@ mod tests {
} }
#[test] #[test]
#[cfg_attr(target_os = "emscripten", ignore)]
fn file_try_clone() { fn file_try_clone() {
let tmpdir = tmpdir(); let tmpdir = tmpdir();
@ -2586,7 +2546,6 @@ mod tests {
} }
#[test] #[test]
#[cfg_attr(target_os = "emscripten", ignore)]
#[cfg(not(windows))] #[cfg(not(windows))]
fn unlink_readonly() { fn unlink_readonly() {
let tmpdir = tmpdir(); let tmpdir = tmpdir();
@ -2599,7 +2558,6 @@ mod tests {
} }
#[test] #[test]
#[cfg_attr(target_os = "emscripten", ignore)]
fn mkdir_trailing_slash() { fn mkdir_trailing_slash() {
let tmpdir = tmpdir(); let tmpdir = tmpdir();
let path = tmpdir.join("file"); let path = tmpdir.join("file");
@ -2607,7 +2565,6 @@ mod tests {
} }
#[test] #[test]
#[cfg_attr(target_os = "emscripten", ignore)]
fn canonicalize_works_simple() { fn canonicalize_works_simple() {
let tmpdir = tmpdir(); let tmpdir = tmpdir();
let tmpdir = fs::canonicalize(tmpdir.path()).unwrap(); let tmpdir = fs::canonicalize(tmpdir.path()).unwrap();
@ -2617,7 +2574,6 @@ mod tests {
} }
#[test] #[test]
#[cfg_attr(target_os = "emscripten", ignore)]
fn realpath_works() { fn realpath_works() {
let tmpdir = tmpdir(); let tmpdir = tmpdir();
if !got_symlink_permission(&tmpdir) { return }; if !got_symlink_permission(&tmpdir) { return };
@ -2643,7 +2599,6 @@ mod tests {
} }
#[test] #[test]
#[cfg_attr(target_os = "emscripten", ignore)]
fn realpath_works_tricky() { fn realpath_works_tricky() {
let tmpdir = tmpdir(); let tmpdir = tmpdir();
if !got_symlink_permission(&tmpdir) { return }; if !got_symlink_permission(&tmpdir) { return };
@ -2673,7 +2628,6 @@ mod tests {
} }
#[test] #[test]
#[cfg_attr(target_os = "emscripten", ignore)]
fn dir_entry_methods() { fn dir_entry_methods() {
let tmpdir = tmpdir(); let tmpdir = tmpdir();
@ -2708,14 +2662,12 @@ mod tests {
} }
#[test] #[test]
#[cfg_attr(target_os = "emscripten", ignore)]
fn read_dir_not_found() { fn read_dir_not_found() {
let res = fs::read_dir("/path/that/does/not/exist"); let res = fs::read_dir("/path/that/does/not/exist");
assert_eq!(res.err().unwrap().kind(), ErrorKind::NotFound); assert_eq!(res.err().unwrap().kind(), ErrorKind::NotFound);
} }
#[test] #[test]
#[cfg_attr(target_os = "emscripten", ignore)]
fn create_dir_all_with_junctions() { fn create_dir_all_with_junctions() {
let tmpdir = tmpdir(); let tmpdir = tmpdir();
let target = tmpdir.join("target"); let target = tmpdir.join("target");
@ -2743,7 +2695,6 @@ mod tests {
} }
#[test] #[test]
#[cfg_attr(target_os = "emscripten", ignore)]
fn metadata_access_times() { fn metadata_access_times() {
let tmpdir = tmpdir(); let tmpdir = tmpdir();

View file

@ -533,7 +533,6 @@ mod tests {
} }
#[test] #[test]
#[cfg_attr(target_os = "emscripten", ignore)]
fn to_socket_addr_str_u16() { fn to_socket_addr_str_u16() {
let a = sa4(Ipv4Addr::new(77, 88, 21, 11), 24352); let a = sa4(Ipv4Addr::new(77, 88, 21, 11), 24352);
assert_eq!(Ok(vec![a]), tsa(("77.88.21.11", 24352))); assert_eq!(Ok(vec![a]), tsa(("77.88.21.11", 24352)));
@ -546,7 +545,6 @@ mod tests {
} }
#[test] #[test]
#[cfg_attr(target_os = "emscripten", ignore)]
fn to_socket_addr_str() { fn to_socket_addr_str() {
let a = sa4(Ipv4Addr::new(77, 88, 21, 11), 24352); let a = sa4(Ipv4Addr::new(77, 88, 21, 11), 24352);
assert_eq!(Ok(vec![a]), tsa("77.88.21.11:24352")); assert_eq!(Ok(vec![a]), tsa("77.88.21.11:24352"));
@ -561,7 +559,6 @@ mod tests {
// FIXME: figure out why this fails on openbsd and bitrig and fix it // FIXME: figure out why this fails on openbsd and bitrig and fix it
#[test] #[test]
#[cfg(not(any(windows, target_os = "openbsd", target_os = "bitrig")))] #[cfg(not(any(windows, target_os = "openbsd", target_os = "bitrig")))]
#[cfg_attr(target_os = "emscripten", ignore)]
fn to_socket_addr_str_bad() { fn to_socket_addr_str_bad() {
assert!(tsa("1200::AB00:1234::2552:7777:1313:34300").is_err()); assert!(tsa("1200::AB00:1234::2552:7777:1313:34300").is_err());
} }

View file

@ -146,7 +146,7 @@ impl<T> Drop for Queue<T> {
} }
} }
#[cfg(test)] #[cfg(all(test, not(target_os = "emscripten")))]
mod tests { mod tests {
use sync::mpsc::channel; use sync::mpsc::channel;
use super::{Queue, Data, Empty, Inconsistent}; use super::{Queue, Data, Empty, Inconsistent};
@ -161,7 +161,6 @@ mod tests {
} }
#[test] #[test]
#[cfg_attr(target_os = "emscripten", ignore)]
fn test() { fn test() {
let nthreads = 8; let nthreads = 8;
let nmsgs = 1000; let nmsgs = 1000;

View file

@ -231,7 +231,7 @@ impl<T> Drop for Queue<T> {
} }
} }
#[cfg(test)] #[cfg(all(test, not(target_os = "emscripten")))]
mod tests { mod tests {
use sync::Arc; use sync::Arc;
use super::Queue; use super::Queue;
@ -305,7 +305,6 @@ mod tests {
} }
#[test] #[test]
#[cfg_attr(target_os = "emscripten", ignore)]
fn stress() { fn stress() {
unsafe { unsafe {
stress_bound(0); stress_bound(0);

View file

@ -352,7 +352,7 @@ pub fn guard_poison<'a, T: ?Sized>(guard: &MutexGuard<'a, T>) -> &'a poison::Fla
&guard.__lock.poison &guard.__lock.poison
} }
#[cfg(test)] #[cfg(all(test, not(target_os = "emscripten")))]
mod tests { mod tests {
use sync::mpsc::channel; use sync::mpsc::channel;
use sync::{Arc, Mutex, Condvar}; use sync::{Arc, Mutex, Condvar};
@ -375,7 +375,6 @@ mod tests {
} }
#[test] #[test]
#[cfg_attr(target_os = "emscripten", ignore)]
fn lots_and_lots() { fn lots_and_lots() {
const J: u32 = 1000; const J: u32 = 1000;
const K: u32 = 3; const K: u32 = 3;
@ -436,7 +435,6 @@ mod tests {
} }
#[test] #[test]
#[cfg_attr(target_os = "emscripten", ignore)]
fn test_into_inner_poison() { fn test_into_inner_poison() {
let m = Arc::new(Mutex::new(NonCopy(10))); let m = Arc::new(Mutex::new(NonCopy(10)));
let m2 = m.clone(); let m2 = m.clone();
@ -460,7 +458,6 @@ mod tests {
} }
#[test] #[test]
#[cfg_attr(target_os = "emscripten", ignore)]
fn test_get_mut_poison() { fn test_get_mut_poison() {
let m = Arc::new(Mutex::new(NonCopy(10))); let m = Arc::new(Mutex::new(NonCopy(10)));
let m2 = m.clone(); let m2 = m.clone();
@ -477,7 +474,6 @@ mod tests {
} }
#[test] #[test]
#[cfg_attr(target_os = "emscripten", ignore)]
fn test_mutex_arc_condvar() { fn test_mutex_arc_condvar() {
let packet = Packet(Arc::new((Mutex::new(false), Condvar::new()))); let packet = Packet(Arc::new((Mutex::new(false), Condvar::new())));
let packet2 = Packet(packet.0.clone()); let packet2 = Packet(packet.0.clone());
@ -501,7 +497,6 @@ mod tests {
} }
#[test] #[test]
#[cfg_attr(target_os = "emscripten", ignore)]
fn test_arc_condvar_poison() { fn test_arc_condvar_poison() {
let packet = Packet(Arc::new((Mutex::new(1), Condvar::new()))); let packet = Packet(Arc::new((Mutex::new(1), Condvar::new())));
let packet2 = Packet(packet.0.clone()); let packet2 = Packet(packet.0.clone());
@ -531,7 +526,6 @@ mod tests {
} }
#[test] #[test]
#[cfg_attr(target_os = "emscripten", ignore)]
fn test_mutex_arc_poison() { fn test_mutex_arc_poison() {
let arc = Arc::new(Mutex::new(1)); let arc = Arc::new(Mutex::new(1));
assert!(!arc.is_poisoned()); assert!(!arc.is_poisoned());
@ -545,7 +539,6 @@ mod tests {
} }
#[test] #[test]
#[cfg_attr(target_os = "emscripten", ignore)]
fn test_mutex_arc_nested() { fn test_mutex_arc_nested() {
// Tests nested mutexes and access // Tests nested mutexes and access
// to underlying data. // to underlying data.
@ -562,7 +555,6 @@ mod tests {
} }
#[test] #[test]
#[cfg_attr(target_os = "emscripten", ignore)]
fn test_mutex_arc_access_in_unwind() { fn test_mutex_arc_access_in_unwind() {
let arc = Arc::new(Mutex::new(1)); let arc = Arc::new(Mutex::new(1));
let arc2 = arc.clone(); let arc2 = arc.clone();

View file

@ -367,7 +367,7 @@ impl OnceState {
} }
} }
#[cfg(test)] #[cfg(all(test, not(target_os = "emscripten")))]
mod tests { mod tests {
use panic; use panic;
use sync::mpsc::channel; use sync::mpsc::channel;
@ -385,7 +385,6 @@ mod tests {
} }
#[test] #[test]
#[cfg_attr(target_os = "emscripten", ignore)]
fn stampede_once() { fn stampede_once() {
static O: Once = Once::new(); static O: Once = Once::new();
static mut run: bool = false; static mut run: bool = false;
@ -448,7 +447,6 @@ mod tests {
} }
#[test] #[test]
#[cfg_attr(target_os = "emscripten", ignore)]
fn wait_for_force_to_finish() { fn wait_for_force_to_finish() {
static O: Once = Once::new(); static O: Once = Once::new();

View file

@ -380,7 +380,7 @@ impl<'a, T: ?Sized> Drop for RwLockWriteGuard<'a, T> {
} }
} }
#[cfg(test)] #[cfg(all(test, not(target_os = "emscripten")))]
mod tests { mod tests {
#![allow(deprecated)] // rand #![allow(deprecated)] // rand
@ -403,7 +403,6 @@ mod tests {
} }
#[test] #[test]
#[cfg_attr(target_os = "emscripten", ignore)]
fn frob() { fn frob() {
const N: usize = 10; const N: usize = 10;
const M: usize = 1000; const M: usize = 1000;
@ -431,7 +430,6 @@ mod tests {
} }
#[test] #[test]
#[cfg_attr(target_os = "emscripten", ignore)]
fn test_rw_arc_poison_wr() { fn test_rw_arc_poison_wr() {
let arc = Arc::new(RwLock::new(1)); let arc = Arc::new(RwLock::new(1));
let arc2 = arc.clone(); let arc2 = arc.clone();
@ -443,7 +441,6 @@ mod tests {
} }
#[test] #[test]
#[cfg_attr(target_os = "emscripten", ignore)]
fn test_rw_arc_poison_ww() { fn test_rw_arc_poison_ww() {
let arc = Arc::new(RwLock::new(1)); let arc = Arc::new(RwLock::new(1));
assert!(!arc.is_poisoned()); assert!(!arc.is_poisoned());
@ -457,7 +454,6 @@ mod tests {
} }
#[test] #[test]
#[cfg_attr(target_os = "emscripten", ignore)]
fn test_rw_arc_no_poison_rr() { fn test_rw_arc_no_poison_rr() {
let arc = Arc::new(RwLock::new(1)); let arc = Arc::new(RwLock::new(1));
let arc2 = arc.clone(); let arc2 = arc.clone();
@ -469,7 +465,6 @@ mod tests {
assert_eq!(*lock, 1); assert_eq!(*lock, 1);
} }
#[test] #[test]
#[cfg_attr(target_os = "emscripten", ignore)]
fn test_rw_arc_no_poison_rw() { fn test_rw_arc_no_poison_rw() {
let arc = Arc::new(RwLock::new(1)); let arc = Arc::new(RwLock::new(1));
let arc2 = arc.clone(); let arc2 = arc.clone();
@ -482,7 +477,6 @@ mod tests {
} }
#[test] #[test]
#[cfg_attr(target_os = "emscripten", ignore)]
fn test_rw_arc() { fn test_rw_arc() {
let arc = Arc::new(RwLock::new(0)); let arc = Arc::new(RwLock::new(0));
let arc2 = arc.clone(); let arc2 = arc.clone();
@ -521,7 +515,6 @@ mod tests {
} }
#[test] #[test]
#[cfg_attr(target_os = "emscripten", ignore)]
fn test_rw_arc_access_in_unwind() { fn test_rw_arc_access_in_unwind() {
let arc = Arc::new(RwLock::new(1)); let arc = Arc::new(RwLock::new(1));
let arc2 = arc.clone(); let arc2 = arc.clone();
@ -594,7 +587,6 @@ mod tests {
} }
#[test] #[test]
#[cfg_attr(target_os = "emscripten", ignore)]
fn test_into_inner_poison() { fn test_into_inner_poison() {
let m = Arc::new(RwLock::new(NonCopy(10))); let m = Arc::new(RwLock::new(NonCopy(10)));
let m2 = m.clone(); let m2 = m.clone();
@ -618,7 +610,6 @@ mod tests {
} }
#[test] #[test]
#[cfg_attr(target_os = "emscripten", ignore)]
fn test_get_mut_poison() { fn test_get_mut_poison() {
let m = Arc::new(RwLock::new(NonCopy(10))); let m = Arc::new(RwLock::new(NonCopy(10)));
let m2 = m.clone(); let m2 = m.clone();

View 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 { pub mod test {
use path::{Path, PathBuf}; use path::{Path, PathBuf};
use env; use env;

View file

@ -156,7 +156,7 @@ impl<'a, T> Drop for ReentrantMutexGuard<'a, T> {
} }
#[cfg(test)] #[cfg(all(test, not(target_os = "emscripten")))]
mod tests { mod tests {
use sys_common::remutex::{ReentrantMutex, ReentrantMutexGuard}; use sys_common::remutex::{ReentrantMutex, ReentrantMutexGuard};
use cell::RefCell; use cell::RefCell;
@ -181,7 +181,6 @@ mod tests {
} }
#[test] #[test]
#[cfg_attr(target_os = "emscripten", ignore)]
fn is_mutex() { fn is_mutex() {
let m = Arc::new(ReentrantMutex::new(RefCell::new(0))); let m = Arc::new(ReentrantMutex::new(RefCell::new(0)));
let m2 = m.clone(); let m2 = m.clone();
@ -199,7 +198,6 @@ mod tests {
} }
#[test] #[test]
#[cfg_attr(target_os = "emscripten", ignore)]
fn trylock_works() { fn trylock_works() {
let m = Arc::new(ReentrantMutex::new(())); let m = Arc::new(ReentrantMutex::new(()));
let m2 = m.clone(); let m2 = m.clone();
@ -220,7 +218,6 @@ mod tests {
} }
#[test] #[test]
#[cfg_attr(target_os = "emscripten", ignore)]
fn poison_works() { fn poison_works() {
let m = Arc::new(ReentrantMutex::new(RefCell::new(0))); let m = Arc::new(ReentrantMutex::new(RefCell::new(0)));
let mc = m.clone(); let mc = m.clone();

View file

@ -786,7 +786,7 @@ impl IntoRawFd for UnixDatagram {
} }
} }
#[cfg(test)] #[cfg(all(test, not(target_os = "emscripten")))]
mod test { mod test {
use thread; use thread;
use io; use io;
@ -806,7 +806,6 @@ mod test {
} }
#[test] #[test]
#[cfg_attr(target_os = "emscripten", ignore)]
fn basic() { fn basic() {
let dir = tmpdir(); let dir = tmpdir();
let socket_path = dir.path().join("sock"); let socket_path = dir.path().join("sock");
@ -835,7 +834,6 @@ mod test {
} }
#[test] #[test]
#[cfg_attr(target_os = "emscripten", ignore)]
fn pair() { fn pair() {
let msg1 = b"hello"; let msg1 = b"hello";
let msg2 = b"world!"; let msg2 = b"world!";
@ -859,7 +857,6 @@ mod test {
} }
#[test] #[test]
#[cfg_attr(target_os = "emscripten", ignore)]
fn try_clone() { fn try_clone() {
let dir = tmpdir(); let dir = tmpdir();
let socket_path = dir.path().join("sock"); let socket_path = dir.path().join("sock");
@ -886,7 +883,6 @@ mod test {
} }
#[test] #[test]
#[cfg_attr(target_os = "emscripten", ignore)]
fn iter() { fn iter() {
let dir = tmpdir(); let dir = tmpdir();
let socket_path = dir.path().join("sock"); let socket_path = dir.path().join("sock");
@ -909,7 +905,6 @@ mod test {
} }
#[test] #[test]
#[cfg_attr(target_os = "emscripten", ignore)]
fn long_path() { fn long_path() {
let dir = tmpdir(); let dir = tmpdir();
let socket_path = dir.path() let socket_path = dir.path()
@ -935,7 +930,6 @@ mod test {
} }
#[test] #[test]
#[cfg_attr(target_os = "emscripten", ignore)]
fn timeouts() { fn timeouts() {
let dir = tmpdir(); let dir = tmpdir();
let socket_path = dir.path().join("sock"); let socket_path = dir.path().join("sock");
@ -963,7 +957,6 @@ mod test {
} }
#[test] #[test]
#[cfg_attr(target_os = "emscripten", ignore)]
fn test_read_timeout() { fn test_read_timeout() {
let dir = tmpdir(); let dir = tmpdir();
let socket_path = dir.path().join("sock"); let socket_path = dir.path().join("sock");
@ -979,7 +972,6 @@ mod test {
} }
#[test] #[test]
#[cfg_attr(target_os = "emscripten", ignore)]
fn test_read_with_timeout() { fn test_read_with_timeout() {
let dir = tmpdir(); let dir = tmpdir();
let socket_path = dir.path().join("sock"); let socket_path = dir.path().join("sock");
@ -1001,7 +993,6 @@ mod test {
} }
#[test] #[test]
#[cfg_attr(target_os = "emscripten", ignore)]
fn test_unix_datagram() { fn test_unix_datagram() {
let dir = tmpdir(); let dir = tmpdir();
let path1 = dir.path().join("sock1"); let path1 = dir.path().join("sock1");
@ -1018,7 +1009,6 @@ mod test {
} }
#[test] #[test]
#[cfg_attr(target_os = "emscripten", ignore)]
fn test_unnamed_unix_datagram() { fn test_unnamed_unix_datagram() {
let dir = tmpdir(); let dir = tmpdir();
let path1 = dir.path().join("sock1"); let path1 = dir.path().join("sock1");
@ -1036,7 +1026,6 @@ mod test {
} }
#[test] #[test]
#[cfg_attr(target_os = "emscripten", ignore)]
fn test_connect_unix_datagram() { fn test_connect_unix_datagram() {
let dir = tmpdir(); let dir = tmpdir();
let path1 = dir.path().join("sock1"); let path1 = dir.path().join("sock1");
@ -1063,7 +1052,6 @@ mod test {
} }
#[test] #[test]
#[cfg_attr(target_os = "emscripten", ignore)]
fn test_unix_datagram_recv() { fn test_unix_datagram_recv() {
let dir = tmpdir(); let dir = tmpdir();
let path1 = dir.path().join("sock1"); let path1 = dir.path().join("sock1");
@ -1081,7 +1069,6 @@ mod test {
} }
#[test] #[test]
#[cfg_attr(target_os = "emscripten", ignore)]
fn datagram_pair() { fn datagram_pair() {
let msg1 = b"hello"; let msg1 = b"hello";
let msg2 = b"world!"; let msg2 = b"world!";

View file

@ -524,7 +524,7 @@ pub mod os {
} }
} }
#[cfg(test)] #[cfg(all(test, not(target_os = "emscripten")))]
mod tests { mod tests {
use sync::mpsc::{channel, Sender}; use sync::mpsc::{channel, Sender};
use cell::{Cell, UnsafeCell}; use cell::{Cell, UnsafeCell};
@ -541,7 +541,6 @@ mod tests {
} }
#[test] #[test]
#[cfg_attr(target_os = "emscripten", ignore)]
fn smoke_no_dtor() { fn smoke_no_dtor() {
thread_local!(static FOO: Cell<i32> = Cell::new(1)); thread_local!(static FOO: Cell<i32> = Cell::new(1));
@ -564,7 +563,6 @@ mod tests {
} }
#[test] #[test]
#[cfg_attr(target_os = "emscripten", ignore)]
fn states() { fn states() {
struct Foo; struct Foo;
impl Drop for Foo { impl Drop for Foo {
@ -588,7 +586,6 @@ mod tests {
} }
#[test] #[test]
#[cfg_attr(target_os = "emscripten", ignore)]
fn smoke_dtor() { fn smoke_dtor() {
thread_local!(static FOO: UnsafeCell<Option<Foo>> = UnsafeCell::new(None)); thread_local!(static FOO: UnsafeCell<Option<Foo>> = UnsafeCell::new(None));
@ -603,7 +600,6 @@ mod tests {
} }
#[test] #[test]
#[cfg_attr(target_os = "emscripten", ignore)]
fn circular() { fn circular() {
struct S1; struct S1;
struct S2; struct S2;
@ -644,7 +640,6 @@ mod tests {
} }
#[test] #[test]
#[cfg_attr(target_os = "emscripten", ignore)]
fn self_referential() { fn self_referential() {
struct S1; struct S1;
thread_local!(static K1: UnsafeCell<Option<S1>> = UnsafeCell::new(None)); thread_local!(static K1: UnsafeCell<Option<S1>> = UnsafeCell::new(None));
@ -666,7 +661,6 @@ mod tests {
// test on OSX. // test on OSX.
#[test] #[test]
#[cfg_attr(target_os = "macos", ignore)] #[cfg_attr(target_os = "macos", ignore)]
#[cfg_attr(target_os = "emscripten", ignore)]
fn dtors_in_dtors_in_dtors() { fn dtors_in_dtors_in_dtors() {
struct S1(Sender<()>); struct S1(Sender<()>);
thread_local!(static K1: UnsafeCell<Option<S1>> = UnsafeCell::new(None)); thread_local!(static K1: UnsafeCell<Option<S1>> = UnsafeCell::new(None));

View file

@ -741,7 +741,7 @@ fn _assert_sync_and_send() {
// Tests // Tests
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
#[cfg(test)] #[cfg(all(test, not(target_os = "emscripten")))]
mod tests { mod tests {
use any::Any; use any::Any;
use sync::mpsc::{channel, Sender}; use sync::mpsc::{channel, Sender};
@ -755,7 +755,6 @@ mod tests {
// !!! instead of exiting cleanly. This might wedge the buildbots. !!! // !!! instead of exiting cleanly. This might wedge the buildbots. !!!
#[test] #[test]
#[cfg_attr(target_os = "emscripten", ignore)]
fn test_unnamed_thread() { fn test_unnamed_thread() {
thread::spawn(move|| { thread::spawn(move|| {
assert!(thread::current().name().is_none()); assert!(thread::current().name().is_none());
@ -763,7 +762,6 @@ mod tests {
} }
#[test] #[test]
#[cfg_attr(target_os = "emscripten", ignore)]
fn test_named_thread() { fn test_named_thread() {
Builder::new().name("ada lovelace".to_string()).spawn(move|| { Builder::new().name("ada lovelace".to_string()).spawn(move|| {
assert!(thread::current().name().unwrap() == "ada lovelace".to_string()); assert!(thread::current().name().unwrap() == "ada lovelace".to_string());
@ -772,13 +770,11 @@ mod tests {
#[test] #[test]
#[should_panic] #[should_panic]
#[cfg_attr(target_os = "emscripten", ignore)]
fn test_invalid_named_thread() { fn test_invalid_named_thread() {
let _ = Builder::new().name("ada l\0velace".to_string()).spawn(|| {}); let _ = Builder::new().name("ada l\0velace".to_string()).spawn(|| {});
} }
#[test] #[test]
#[cfg_attr(target_os = "emscripten", ignore)]
fn test_run_basic() { fn test_run_basic() {
let (tx, rx) = channel(); let (tx, rx) = channel();
thread::spawn(move|| { thread::spawn(move|| {
@ -788,7 +784,6 @@ mod tests {
} }
#[test] #[test]
#[cfg_attr(target_os = "emscripten", ignore)]
fn test_join_panic() { fn test_join_panic() {
match thread::spawn(move|| { match thread::spawn(move|| {
panic!() panic!()
@ -799,7 +794,6 @@ mod tests {
} }
#[test] #[test]
#[cfg_attr(target_os = "emscripten", ignore)]
fn test_spawn_sched() { fn test_spawn_sched() {
let (tx, rx) = channel(); let (tx, rx) = channel();
@ -819,7 +813,6 @@ mod tests {
} }
#[test] #[test]
#[cfg_attr(target_os = "emscripten", ignore)]
fn test_spawn_sched_childs_on_default_sched() { fn test_spawn_sched_childs_on_default_sched() {
let (tx, rx) = channel(); let (tx, rx) = channel();
@ -848,7 +841,6 @@ mod tests {
} }
#[test] #[test]
#[cfg_attr(target_os = "emscripten", ignore)]
fn test_avoid_copying_the_body_spawn() { fn test_avoid_copying_the_body_spawn() {
avoid_copying_the_body(|v| { avoid_copying_the_body(|v| {
thread::spawn(move || v()); thread::spawn(move || v());
@ -856,7 +848,6 @@ mod tests {
} }
#[test] #[test]
#[cfg_attr(target_os = "emscripten", ignore)]
fn test_avoid_copying_the_body_thread_spawn() { fn test_avoid_copying_the_body_thread_spawn() {
avoid_copying_the_body(|f| { avoid_copying_the_body(|f| {
thread::spawn(move|| { thread::spawn(move|| {
@ -866,7 +857,6 @@ mod tests {
} }
#[test] #[test]
#[cfg_attr(target_os = "emscripten", ignore)]
fn test_avoid_copying_the_body_join() { fn test_avoid_copying_the_body_join() {
avoid_copying_the_body(|f| { avoid_copying_the_body(|f| {
let _ = thread::spawn(move|| { let _ = thread::spawn(move|| {
@ -876,7 +866,6 @@ mod tests {
} }
#[test] #[test]
#[cfg_attr(target_os = "emscripten", ignore)]
fn test_child_doesnt_ref_parent() { fn test_child_doesnt_ref_parent() {
// If the child refcounts the parent thread, this will stack overflow when // If the child refcounts the parent thread, this will stack overflow when
// climbing the thread tree to dereference each ancestor. (See #1789) // climbing the thread tree to dereference each ancestor. (See #1789)
@ -894,13 +883,11 @@ mod tests {
} }
#[test] #[test]
#[cfg_attr(target_os = "emscripten", ignore)]
fn test_simple_newsched_spawn() { fn test_simple_newsched_spawn() {
thread::spawn(move || {}); thread::spawn(move || {});
} }
#[test] #[test]
#[cfg_attr(target_os = "emscripten", ignore)]
fn test_try_panic_message_static_str() { fn test_try_panic_message_static_str() {
match thread::spawn(move|| { match thread::spawn(move|| {
panic!("static string"); panic!("static string");
@ -915,7 +902,6 @@ mod tests {
} }
#[test] #[test]
#[cfg_attr(target_os = "emscripten", ignore)]
fn test_try_panic_message_owned_str() { fn test_try_panic_message_owned_str() {
match thread::spawn(move|| { match thread::spawn(move|| {
panic!("owned string".to_string()); panic!("owned string".to_string());
@ -930,7 +916,6 @@ mod tests {
} }
#[test] #[test]
#[cfg_attr(target_os = "emscripten", ignore)]
fn test_try_panic_message_any() { fn test_try_panic_message_any() {
match thread::spawn(move|| { match thread::spawn(move|| {
panic!(box 413u16 as Box<Any + Send>); panic!(box 413u16 as Box<Any + Send>);
@ -947,7 +932,6 @@ mod tests {
} }
#[test] #[test]
#[cfg_attr(target_os = "emscripten", ignore)]
fn test_try_panic_message_unit_struct() { fn test_try_panic_message_unit_struct() {
struct Juju; struct Juju;
@ -960,7 +944,6 @@ mod tests {
} }
#[test] #[test]
#[cfg_attr(target_os = "emscripten", ignore)]
fn test_park_timeout_unpark_before() { fn test_park_timeout_unpark_before() {
for _ in 0..10 { for _ in 0..10 {
thread::current().unpark(); thread::current().unpark();
@ -969,7 +952,6 @@ mod tests {
} }
#[test] #[test]
#[cfg_attr(target_os = "emscripten", ignore)]
fn test_park_timeout_unpark_not_called() { fn test_park_timeout_unpark_not_called() {
for _ in 0..10 { for _ in 0..10 {
thread::park_timeout(Duration::from_millis(10)); thread::park_timeout(Duration::from_millis(10));
@ -977,7 +959,6 @@ mod tests {
} }
#[test] #[test]
#[cfg_attr(target_os = "emscripten", ignore)]
fn test_park_timeout_unpark_called_other_thread() { fn test_park_timeout_unpark_called_other_thread() {
for _ in 0..10 { for _ in 0..10 {
let th = thread::current(); let th = thread::current();