Ignore various entire test modules on emscripten
This commit is contained in:
parent
525a798ca6
commit
096670ca41
12 changed files with 11 additions and 125 deletions
|
@ -1686,7 +1686,7 @@ impl AsInnerMut<fs_imp::DirBuilder> for DirBuilder {
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
#[cfg(all(test, not(target_os = "emscripten")))]
|
||||
mod tests {
|
||||
use io::prelude::*;
|
||||
|
||||
|
@ -1745,7 +1745,6 @@ mod tests {
|
|||
}
|
||||
|
||||
#[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 @@ mod tests {
|
|||
}
|
||||
|
||||
#[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 @@ mod tests {
|
|||
}
|
||||
|
||||
#[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 @@ mod tests {
|
|||
}
|
||||
|
||||
#[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 @@ mod tests {
|
|||
}
|
||||
|
||||
#[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 @@ mod tests {
|
|||
}
|
||||
|
||||
#[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 @@ mod tests {
|
|||
}
|
||||
|
||||
#[test]
|
||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
||||
fn file_test_io_seek_shakedown() {
|
||||
// 01234567890123
|
||||
let initial_msg = "qwer-asdf-zxcv";
|
||||
|
@ -1911,7 +1904,6 @@ mod tests {
|
|||
}
|
||||
|
||||
#[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 @@ mod tests {
|
|||
}
|
||||
|
||||
#[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 @@ mod tests {
|
|||
}
|
||||
|
||||
#[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 @@ mod tests {
|
|||
}
|
||||
|
||||
#[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 @@ mod tests {
|
|||
}
|
||||
|
||||
#[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 @@ mod tests {
|
|||
}
|
||||
|
||||
#[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 @@ mod tests {
|
|||
}
|
||||
|
||||
#[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 @@ mod tests {
|
|||
}
|
||||
|
||||
#[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 @@ mod tests {
|
|||
}
|
||||
|
||||
#[test]
|
||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
||||
fn recursive_mkdir() {
|
||||
let tmpdir = tmpdir();
|
||||
let dir = tmpdir.join("d1/d2");
|
||||
|
@ -2039,7 +2023,6 @@ mod tests {
|
|||
}
|
||||
|
||||
#[test]
|
||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
||||
fn recursive_mkdir_failure() {
|
||||
let tmpdir = tmpdir();
|
||||
let dir = tmpdir.join("d1");
|
||||
|
@ -2054,13 +2037,11 @@ mod tests {
|
|||
}
|
||||
|
||||
#[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 @@ mod tests {
|
|||
}
|
||||
|
||||
#[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 @@ mod tests {
|
|||
}
|
||||
|
||||
#[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 @@ mod tests {
|
|||
}
|
||||
|
||||
#[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 @@ mod tests {
|
|||
}
|
||||
|
||||
#[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 @@ mod tests {
|
|||
}
|
||||
|
||||
#[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 @@ mod tests {
|
|||
}
|
||||
|
||||
#[test]
|
||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
||||
fn copy_file_ok() {
|
||||
let tmpdir = tmpdir();
|
||||
let input = tmpdir.join("in.txt");
|
||||
|
@ -2194,7 +2169,6 @@ mod tests {
|
|||
}
|
||||
|
||||
#[test]
|
||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
||||
fn copy_file_dst_dir() {
|
||||
let tmpdir = tmpdir();
|
||||
let out = tmpdir.join("out");
|
||||
|
@ -2206,7 +2180,6 @@ mod tests {
|
|||
}
|
||||
|
||||
#[test]
|
||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
||||
fn copy_file_dst_exists() {
|
||||
let tmpdir = tmpdir();
|
||||
let input = tmpdir.join("in");
|
||||
|
@ -2222,7 +2195,6 @@ mod tests {
|
|||
}
|
||||
|
||||
#[test]
|
||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
||||
fn copy_file_src_dir() {
|
||||
let tmpdir = tmpdir();
|
||||
let out = tmpdir.join("out");
|
||||
|
@ -2234,7 +2206,6 @@ mod tests {
|
|||
}
|
||||
|
||||
#[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 @@ mod tests {
|
|||
}
|
||||
|
||||
#[test]
|
||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
||||
fn symlinks_work() {
|
||||
let tmpdir = tmpdir();
|
||||
if !got_symlink_permission(&tmpdir) { return };
|
||||
|
@ -2282,7 +2252,6 @@ mod tests {
|
|||
}
|
||||
|
||||
#[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 @@ mod tests {
|
|||
}
|
||||
|
||||
#[test]
|
||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
||||
fn read_link() {
|
||||
if cfg!(windows) {
|
||||
// directory symlink
|
||||
|
@ -2317,7 +2285,6 @@ mod tests {
|
|||
}
|
||||
|
||||
#[test]
|
||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
||||
fn readlink_not_symlink() {
|
||||
let tmpdir = tmpdir();
|
||||
match fs::read_link(tmpdir.path()) {
|
||||
|
@ -2327,7 +2294,6 @@ mod tests {
|
|||
}
|
||||
|
||||
#[test]
|
||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
||||
fn links_work() {
|
||||
let tmpdir = tmpdir();
|
||||
let input = tmpdir.join("in.txt");
|
||||
|
@ -2356,7 +2322,6 @@ mod tests {
|
|||
}
|
||||
|
||||
#[test]
|
||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
||||
fn chmod_works() {
|
||||
let tmpdir = tmpdir();
|
||||
let file = tmpdir.join("in.txt");
|
||||
|
@ -2380,7 +2345,6 @@ mod tests {
|
|||
}
|
||||
|
||||
#[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 @@ mod tests {
|
|||
}
|
||||
|
||||
#[test]
|
||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
||||
fn truncate_works() {
|
||||
let tmpdir = tmpdir();
|
||||
let path = tmpdir.join("in.txt");
|
||||
|
@ -2429,7 +2392,6 @@ mod tests {
|
|||
}
|
||||
|
||||
#[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 @@ mod tests {
|
|||
}
|
||||
|
||||
#[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 @@ mod tests {
|
|||
}
|
||||
|
||||
#[test]
|
||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
||||
fn file_try_clone() {
|
||||
let tmpdir = tmpdir();
|
||||
|
||||
|
@ -2586,7 +2546,6 @@ mod tests {
|
|||
}
|
||||
|
||||
#[test]
|
||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
||||
#[cfg(not(windows))]
|
||||
fn unlink_readonly() {
|
||||
let tmpdir = tmpdir();
|
||||
|
@ -2599,7 +2558,6 @@ mod tests {
|
|||
}
|
||||
|
||||
#[test]
|
||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
||||
fn mkdir_trailing_slash() {
|
||||
let tmpdir = tmpdir();
|
||||
let path = tmpdir.join("file");
|
||||
|
@ -2607,7 +2565,6 @@ mod tests {
|
|||
}
|
||||
|
||||
#[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 @@ mod tests {
|
|||
}
|
||||
|
||||
#[test]
|
||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
||||
fn realpath_works() {
|
||||
let tmpdir = tmpdir();
|
||||
if !got_symlink_permission(&tmpdir) { return };
|
||||
|
@ -2643,7 +2599,6 @@ mod tests {
|
|||
}
|
||||
|
||||
#[test]
|
||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
||||
fn realpath_works_tricky() {
|
||||
let tmpdir = tmpdir();
|
||||
if !got_symlink_permission(&tmpdir) { return };
|
||||
|
@ -2673,7 +2628,6 @@ mod tests {
|
|||
}
|
||||
|
||||
#[test]
|
||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
||||
fn dir_entry_methods() {
|
||||
let tmpdir = tmpdir();
|
||||
|
||||
|
@ -2708,14 +2662,12 @@ mod tests {
|
|||
}
|
||||
|
||||
#[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 @@ mod tests {
|
|||
}
|
||||
|
||||
#[test]
|
||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
||||
fn metadata_access_times() {
|
||||
let tmpdir = tmpdir();
|
||||
|
||||
|
|
|
@ -533,7 +533,6 @@ mod tests {
|
|||
}
|
||||
|
||||
#[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 @@ mod tests {
|
|||
}
|
||||
|
||||
#[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 @@ mod tests {
|
|||
// 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());
|
||||
}
|
||||
|
|
|
@ -146,7 +146,7 @@ impl<T> Drop for Queue<T> {
|
|||
}
|
||||
}
|
||||
|
||||
#[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 @@ mod tests {
|
|||
}
|
||||
|
||||
#[test]
|
||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
||||
fn test() {
|
||||
let nthreads = 8;
|
||||
let nmsgs = 1000;
|
||||
|
|
|
@ -231,7 +231,7 @@ impl<T> Drop for Queue<T> {
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
#[cfg(all(test, not(target_os = "emscripten")))]
|
||||
mod tests {
|
||||
use sync::Arc;
|
||||
use super::Queue;
|
||||
|
@ -305,7 +305,6 @@ mod tests {
|
|||
}
|
||||
|
||||
#[test]
|
||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
||||
fn stress() {
|
||||
unsafe {
|
||||
stress_bound(0);
|
||||
|
|
|
@ -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 @@ mod tests {
|
|||
}
|
||||
|
||||
#[test]
|
||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
||||
fn lots_and_lots() {
|
||||
const J: u32 = 1000;
|
||||
const K: u32 = 3;
|
||||
|
@ -436,7 +435,6 @@ mod tests {
|
|||
}
|
||||
|
||||
#[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 @@ mod tests {
|
|||
}
|
||||
|
||||
#[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 @@ mod tests {
|
|||
}
|
||||
|
||||
#[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 @@ mod tests {
|
|||
}
|
||||
|
||||
#[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 @@ mod tests {
|
|||
}
|
||||
|
||||
#[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 @@ mod tests {
|
|||
}
|
||||
|
||||
#[test]
|
||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
||||
fn test_mutex_arc_nested() {
|
||||
// Tests nested mutexes and access
|
||||
// to underlying data.
|
||||
|
@ -562,7 +555,6 @@ mod tests {
|
|||
}
|
||||
|
||||
#[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();
|
||||
|
|
|
@ -367,7 +367,7 @@ impl OnceState {
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
#[cfg(all(test, not(target_os = "emscripten")))]
|
||||
mod tests {
|
||||
use panic;
|
||||
use sync::mpsc::channel;
|
||||
|
@ -385,7 +385,6 @@ mod tests {
|
|||
}
|
||||
|
||||
#[test]
|
||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
||||
fn stampede_once() {
|
||||
static O: Once = Once::new();
|
||||
static mut run: bool = false;
|
||||
|
@ -448,7 +447,6 @@ mod tests {
|
|||
}
|
||||
|
||||
#[test]
|
||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
||||
fn wait_for_force_to_finish() {
|
||||
static O: Once = Once::new();
|
||||
|
||||
|
|
|
@ -380,7 +380,7 @@ impl<'a, T: ?Sized> Drop for RwLockWriteGuard<'a, T> {
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
#[cfg(all(test, not(target_os = "emscripten")))]
|
||||
mod tests {
|
||||
#![allow(deprecated)] // rand
|
||||
|
||||
|
@ -403,7 +403,6 @@ mod tests {
|
|||
}
|
||||
|
||||
#[test]
|
||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
||||
fn frob() {
|
||||
const N: usize = 10;
|
||||
const M: usize = 1000;
|
||||
|
@ -431,7 +430,6 @@ mod tests {
|
|||
}
|
||||
|
||||
#[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 @@ mod tests {
|
|||
}
|
||||
|
||||
#[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 @@ mod tests {
|
|||
}
|
||||
|
||||
#[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 @@ mod tests {
|
|||
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 @@ mod tests {
|
|||
}
|
||||
|
||||
#[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 @@ mod tests {
|
|||
}
|
||||
|
||||
#[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 @@ mod tests {
|
|||
}
|
||||
|
||||
#[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 @@ mod tests {
|
|||
}
|
||||
|
||||
#[test]
|
||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
||||
fn test_get_mut_poison() {
|
||||
let m = Arc::new(RwLock::new(NonCopy(10)));
|
||||
let m2 = m.clone();
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -156,7 +156,7 @@ impl<'a, T> Drop for ReentrantMutexGuard<'a, T> {
|
|||
}
|
||||
|
||||
|
||||
#[cfg(test)]
|
||||
#[cfg(all(test, not(target_os = "emscripten")))]
|
||||
mod tests {
|
||||
use sys_common::remutex::{ReentrantMutex, ReentrantMutexGuard};
|
||||
use cell::RefCell;
|
||||
|
@ -181,7 +181,6 @@ mod tests {
|
|||
}
|
||||
|
||||
#[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 @@ mod tests {
|
|||
}
|
||||
|
||||
#[test]
|
||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
||||
fn trylock_works() {
|
||||
let m = Arc::new(ReentrantMutex::new(()));
|
||||
let m2 = m.clone();
|
||||
|
@ -220,7 +218,6 @@ mod tests {
|
|||
}
|
||||
|
||||
#[test]
|
||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
||||
fn poison_works() {
|
||||
let m = Arc::new(ReentrantMutex::new(RefCell::new(0)));
|
||||
let mc = m.clone();
|
||||
|
|
|
@ -786,7 +786,7 @@ impl IntoRawFd for UnixDatagram {
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
#[cfg(all(test, not(target_os = "emscripten")))]
|
||||
mod test {
|
||||
use thread;
|
||||
use io;
|
||||
|
@ -806,7 +806,6 @@ mod test {
|
|||
}
|
||||
|
||||
#[test]
|
||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
||||
fn basic() {
|
||||
let dir = tmpdir();
|
||||
let socket_path = dir.path().join("sock");
|
||||
|
@ -835,7 +834,6 @@ mod test {
|
|||
}
|
||||
|
||||
#[test]
|
||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
||||
fn pair() {
|
||||
let msg1 = b"hello";
|
||||
let msg2 = b"world!";
|
||||
|
@ -859,7 +857,6 @@ mod test {
|
|||
}
|
||||
|
||||
#[test]
|
||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
||||
fn try_clone() {
|
||||
let dir = tmpdir();
|
||||
let socket_path = dir.path().join("sock");
|
||||
|
@ -886,7 +883,6 @@ mod test {
|
|||
}
|
||||
|
||||
#[test]
|
||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
||||
fn iter() {
|
||||
let dir = tmpdir();
|
||||
let socket_path = dir.path().join("sock");
|
||||
|
@ -909,7 +905,6 @@ mod test {
|
|||
}
|
||||
|
||||
#[test]
|
||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
||||
fn long_path() {
|
||||
let dir = tmpdir();
|
||||
let socket_path = dir.path()
|
||||
|
@ -935,7 +930,6 @@ mod test {
|
|||
}
|
||||
|
||||
#[test]
|
||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
||||
fn timeouts() {
|
||||
let dir = tmpdir();
|
||||
let socket_path = dir.path().join("sock");
|
||||
|
@ -963,7 +957,6 @@ mod test {
|
|||
}
|
||||
|
||||
#[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 @@ mod test {
|
|||
}
|
||||
|
||||
#[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 @@ mod test {
|
|||
}
|
||||
|
||||
#[test]
|
||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
||||
fn test_unix_datagram() {
|
||||
let dir = tmpdir();
|
||||
let path1 = dir.path().join("sock1");
|
||||
|
@ -1018,7 +1009,6 @@ mod test {
|
|||
}
|
||||
|
||||
#[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 @@ mod test {
|
|||
}
|
||||
|
||||
#[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 @@ mod test {
|
|||
}
|
||||
|
||||
#[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 @@ mod test {
|
|||
}
|
||||
|
||||
#[test]
|
||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
||||
fn datagram_pair() {
|
||||
let msg1 = b"hello";
|
||||
let msg2 = b"world!";
|
||||
|
|
|
@ -524,7 +524,7 @@ pub mod os {
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
#[cfg(all(test, not(target_os = "emscripten")))]
|
||||
mod tests {
|
||||
use sync::mpsc::{channel, Sender};
|
||||
use cell::{Cell, UnsafeCell};
|
||||
|
@ -541,7 +541,6 @@ mod tests {
|
|||
}
|
||||
|
||||
#[test]
|
||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
||||
fn smoke_no_dtor() {
|
||||
thread_local!(static FOO: Cell<i32> = Cell::new(1));
|
||||
|
||||
|
@ -564,7 +563,6 @@ mod tests {
|
|||
}
|
||||
|
||||
#[test]
|
||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
||||
fn states() {
|
||||
struct Foo;
|
||||
impl Drop for Foo {
|
||||
|
@ -588,7 +586,6 @@ mod tests {
|
|||
}
|
||||
|
||||
#[test]
|
||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
||||
fn smoke_dtor() {
|
||||
thread_local!(static FOO: UnsafeCell<Option<Foo>> = UnsafeCell::new(None));
|
||||
|
||||
|
@ -603,7 +600,6 @@ mod tests {
|
|||
}
|
||||
|
||||
#[test]
|
||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
||||
fn circular() {
|
||||
struct S1;
|
||||
struct S2;
|
||||
|
@ -644,7 +640,6 @@ mod tests {
|
|||
}
|
||||
|
||||
#[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 @@ mod tests {
|
|||
// 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));
|
||||
|
|
|
@ -741,7 +741,7 @@ fn _assert_sync_and_send() {
|
|||
// 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 @@ mod tests {
|
|||
}
|
||||
|
||||
#[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 @@ mod tests {
|
|||
|
||||
#[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 @@ mod tests {
|
|||
}
|
||||
|
||||
#[test]
|
||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
||||
fn test_join_panic() {
|
||||
match thread::spawn(move|| {
|
||||
panic!()
|
||||
|
@ -799,7 +794,6 @@ mod tests {
|
|||
}
|
||||
|
||||
#[test]
|
||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
||||
fn test_spawn_sched() {
|
||||
let (tx, rx) = channel();
|
||||
|
||||
|
@ -819,7 +813,6 @@ mod tests {
|
|||
}
|
||||
|
||||
#[test]
|
||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
||||
fn test_spawn_sched_childs_on_default_sched() {
|
||||
let (tx, rx) = channel();
|
||||
|
||||
|
@ -848,7 +841,6 @@ mod tests {
|
|||
}
|
||||
|
||||
#[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 @@ mod tests {
|
|||
}
|
||||
|
||||
#[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 @@ mod tests {
|
|||
}
|
||||
|
||||
#[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 @@ mod tests {
|
|||
}
|
||||
|
||||
#[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 @@ mod tests {
|
|||
}
|
||||
|
||||
#[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 @@ mod tests {
|
|||
}
|
||||
|
||||
#[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 @@ mod tests {
|
|||
}
|
||||
|
||||
#[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 @@ mod tests {
|
|||
}
|
||||
|
||||
#[test]
|
||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
||||
fn test_try_panic_message_unit_struct() {
|
||||
struct Juju;
|
||||
|
||||
|
@ -960,7 +944,6 @@ mod tests {
|
|||
}
|
||||
|
||||
#[test]
|
||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
||||
fn test_park_timeout_unpark_before() {
|
||||
for _ in 0..10 {
|
||||
thread::current().unpark();
|
||||
|
@ -969,7 +952,6 @@ mod tests {
|
|||
}
|
||||
|
||||
#[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 @@ mod tests {
|
|||
}
|
||||
|
||||
#[test]
|
||||
#[cfg_attr(target_os = "emscripten", ignore)]
|
||||
fn test_park_timeout_unpark_called_other_thread() {
|
||||
for _ in 0..10 {
|
||||
let th = thread::current();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue