diff --git a/mk/tests.mk b/mk/tests.mk index 37ce99f4e6e..2e91fc06bcd 100644 --- a/mk/tests.mk +++ b/mk/tests.mk @@ -870,7 +870,8 @@ $(foreach host,$(CFG_HOST_TRIPLES), \ $(eval $(foreach target,$(CFG_TARGET_TRIPLES), \ $(eval $(call DEF_CHECK_FAST_FOR_T_H,,$(target),$(host)))))) -check-fast: tidy check-fast-H-$(CFG_BUILD_TRIPLE) +check-fast: tidy check-fast-H-$(CFG_BUILD_TRIPLE) check-stage2-std check-stage2-extra + $(Q)$(CFG_PYTHON) $(S)src/etc/check-summary.py tmp/*.log define DEF_CHECK_FAST_FOR_H diff --git a/src/libstd/num/f32.rs b/src/libstd/num/f32.rs index 1c59eaf0219..6757e3020da 100644 --- a/src/libstd/num/f32.rs +++ b/src/libstd/num/f32.rs @@ -1142,6 +1142,10 @@ mod tests { assert_eq!(infinity.abs_sub(&1f32), infinity); assert_eq!(0f32.abs_sub(&neg_infinity), infinity); assert_eq!(0f32.abs_sub(&infinity), 0f32); + } + + #[test] #[ignore(cfg(windows))] // FIXME #8663 + fn test_abs_sub_nowin() { assert!(NaN.abs_sub(&-1f32).is_NaN()); assert!(1f32.abs_sub(&NaN).is_NaN()); } @@ -1267,7 +1271,10 @@ mod tests { assert_eq!(0f32.frexp(), (0f32, 0)); assert_eq!((-0f32).frexp(), (-0f32, 0)); + } + #[test] #[ignore(cfg(windows))] // FIXME #8755 + fn test_frexp_nowin() { let inf: f32 = Float::infinity(); let neg_inf: f32 = Float::neg_infinity(); let nan: f32 = Float::NaN(); diff --git a/src/libstd/num/f64.rs b/src/libstd/num/f64.rs index 8f5d6473aea..59389c28557 100644 --- a/src/libstd/num/f64.rs +++ b/src/libstd/num/f64.rs @@ -1192,6 +1192,10 @@ mod tests { assert_eq!(infinity.abs_sub(&1f64), infinity); assert_eq!(0f64.abs_sub(&neg_infinity), infinity); assert_eq!(0f64.abs_sub(&infinity), 0f64); + } + + #[test] #[ignore(cfg(windows))] // FIXME #8663 + fn test_abs_sub_nowin() { assert!(NaN.abs_sub(&-1f64).is_NaN()); assert!(1f64.abs_sub(&NaN).is_NaN()); } @@ -1316,7 +1320,10 @@ mod tests { assert_eq!(0f64.frexp(), (0f64, 0)); assert_eq!((-0f64).frexp(), (-0f64, 0)); + } + #[test] #[ignore(cfg(windows))] // FIXME #8755 + fn test_frexp_nowin() { let inf: f64 = Float::infinity(); let neg_inf: f64 = Float::neg_infinity(); let nan: f64 = Float::NaN(); diff --git a/src/libstd/num/float.rs b/src/libstd/num/float.rs index d019de2468b..909eac0cb69 100644 --- a/src/libstd/num/float.rs +++ b/src/libstd/num/float.rs @@ -1163,6 +1163,10 @@ mod tests { assert_eq!(infinity.abs_sub(&1f), infinity); assert_eq!(0f.abs_sub(&neg_infinity), infinity); assert_eq!(0f.abs_sub(&infinity), 0f); + } + + #[test] #[ignore(cfg(windows))] // FIXME #8663 + fn test_abs_sub_nowin() { assert!(NaN.abs_sub(&-1f).is_NaN()); assert!(1f.abs_sub(&NaN).is_NaN()); } @@ -1288,7 +1292,10 @@ mod tests { assert_eq!(0f.frexp(), (0f, 0)); assert_eq!((-0f).frexp(), (-0f, 0)); + } + #[test] #[ignore(cfg(windows))] // FIXME #8755 + fn test_frexp_nowin() { let inf: float = Float::infinity(); let neg_inf: float = Float::neg_infinity(); let nan: float = Float::NaN(); diff --git a/src/libstd/os.rs b/src/libstd/os.rs index 7aae9425302..07e0b0857a1 100644 --- a/src/libstd/os.rs +++ b/src/libstd/os.rs @@ -1418,12 +1418,12 @@ pub fn page_size() -> uint { pub fn page_size() -> uint { #[fixed_stack_segment]; #[inline(never)]; - unsafe { - let mut info = libc::SYSTEM_INFO::new(); - libc::GetSystemInfo(&mut info); + unsafe { + let mut info = libc::SYSTEM_INFO::new(); + libc::GetSystemInfo(&mut info); - return info.dwPageSize as uint; - } + return info.dwPageSize as uint; + } } pub struct MemoryMap { @@ -1458,7 +1458,6 @@ pub enum MapError { // Windows-specific errors ErrUnsupProt, ErrUnsupOffset, - ErrNeedRW, ErrAlreadyExists, ErrVirtualAlloc(uint), ErrCreateFileMappingW(uint), @@ -1477,7 +1476,6 @@ impl to_str::ToStr for MapError { ErrUnknown(code) => fmt!("Unknown error=%?", code), ErrUnsupProt => ~"Protection mode unsupported", ErrUnsupOffset => ~"Offset in virtual memory mode is unsupported", - ErrNeedRW => ~"File mapping should be at least readable/writable", ErrAlreadyExists => ~"File mapping for specified file already exists", ErrVirtualAlloc(code) => fmt!("VirtualAlloc failure=%?", code), ErrCreateFileMappingW(code) => fmt!("CreateFileMappingW failure=%?", code), @@ -1542,6 +1540,10 @@ impl MemoryMap { }) } } + + pub fn granularity() -> uint { + page_size() + } } #[cfg(unix)] @@ -1617,21 +1619,21 @@ impl MemoryMap { }) } } else { - let dwDesiredAccess = match (readable, writable) { - (true, true) => libc::FILE_MAP_ALL_ACCESS, - (true, false) => libc::FILE_MAP_READ, - (false, true) => libc::FILE_MAP_WRITE, - _ => { - return Err(ErrNeedRW); - } + let dwDesiredAccess = match (executable, readable, writable) { + (false, true, false) => libc::FILE_MAP_READ, + (false, true, true) => libc::FILE_MAP_WRITE, + (true, true, false) => libc::FILE_MAP_READ | libc::FILE_MAP_EXECUTE, + (true, true, true) => libc::FILE_MAP_WRITE | libc::FILE_MAP_EXECUTE, + _ => return Err(ErrUnsupProt) // Actually, because of the check above, + // we should never get here. }; unsafe { let hFile = libc::get_osfhandle(fd) as HANDLE; let mapping = libc::CreateFileMappingW(hFile, ptr::mut_null(), flProtect, - (len >> 32) as DWORD, - (len & 0xffff_ffff) as DWORD, + 0, + 0, ptr::null()); if mapping == ptr::mut_null() { return Err(ErrCreateFileMappingW(errno())); @@ -1641,7 +1643,7 @@ impl MemoryMap { } let r = libc::MapViewOfFile(mapping, dwDesiredAccess, - (offset >> 32) as DWORD, + ((len as u64) >> 32) as DWORD, (offset & 0xffff_ffff) as DWORD, 0); match r as uint { @@ -1655,6 +1657,19 @@ impl MemoryMap { } } } + + /// Granularity of MapAddr() and MapOffset() parameter values. + /// This may be greater than the value returned by page_size(). + pub fn granularity() -> uint { + #[fixed_stack_segment]; #[inline(never)]; + + unsafe { + let mut info = libc::SYSTEM_INFO::new(); + libc::GetSystemInfo(&mut info); + + return info.dwAllocationGranularity as uint; + } + } } #[cfg(windows)] @@ -1663,20 +1678,22 @@ impl Drop for MemoryMap { #[fixed_stack_segment]; #[inline(never)]; use libc::types::os::arch::extra::{LPCVOID, HANDLE}; + use libc::consts::os::extra::FALSE; unsafe { match self.kind { - MapVirtual => match libc::VirtualFree(self.data as *mut c_void, - self.len, - libc::MEM_RELEASE) { - 0 => error!(fmt!("VirtualFree failed: %?", errno())), - _ => () + MapVirtual => { + if libc::VirtualFree(self.data as *mut c_void, + self.len, + libc::MEM_RELEASE) == FALSE { + error!(fmt!("VirtualFree failed: %?", errno())); + } }, MapFile(mapping) => { - if libc::UnmapViewOfFile(self.data as LPCVOID) != 0 { + if libc::UnmapViewOfFile(self.data as LPCVOID) == FALSE { error!(fmt!("UnmapViewOfFile failed: %?", errno())); } - if libc::CloseHandle(mapping as HANDLE) != 0 { + if libc::CloseHandle(mapping as HANDLE) == FALSE { error!(fmt!("CloseHandle failed: %?", errno())); } } @@ -2108,7 +2125,7 @@ mod tests { } let path = tmpdir().push("mmap_file.tmp"); - let size = page_size() * 2; + let size = MemoryMap::granularity() * 2; remove_file(&path); let fd = unsafe { diff --git a/src/libstd/rt/io/file.rs b/src/libstd/rt/io/file.rs index f4e9c4d7c11..3fb00720406 100644 --- a/src/libstd/rt/io/file.rs +++ b/src/libstd/rt/io/file.rs @@ -168,6 +168,7 @@ fn file_test_smoke_test_impl() { } #[test] +#[ignore(cfg(windows))] // FIXME #8810 fn file_test_io_smoke_test() { file_test_smoke_test_impl(); } @@ -235,6 +236,7 @@ fn file_test_io_non_positional_read_impl() { } #[test] +#[ignore(cfg(windows))] // FIXME #8810 fn file_test_io_non_positional_read() { file_test_io_non_positional_read_impl(); } @@ -267,6 +269,7 @@ fn file_test_io_seeking_impl() { } } #[test] +#[ignore(cfg(windows))] // FIXME #8810 fn file_test_io_seek_and_tell_smoke_test() { file_test_io_seeking_impl(); } @@ -298,6 +301,7 @@ fn file_test_io_seek_and_write_impl() { } } #[test] +#[ignore(cfg(windows))] // FIXME #8810 fn file_test_io_seek_and_write() { file_test_io_seek_and_write_impl(); } @@ -337,6 +341,7 @@ fn file_test_io_seek_shakedown_impl() { } } #[test] +#[ignore(cfg(windows))] // FIXME #8810 fn file_test_io_seek_shakedown() { file_test_io_seek_shakedown_impl(); } diff --git a/src/libstd/rt/io/net/tcp.rs b/src/libstd/rt/io/net/tcp.rs index 9be5540de48..ce66cd0de59 100644 --- a/src/libstd/rt/io/net/tcp.rs +++ b/src/libstd/rt/io/net/tcp.rs @@ -162,6 +162,7 @@ mod test { } #[test] + #[ignore(cfg(windows))] // FIXME #8811 fn connect_error() { do run_in_newsched_task { let mut called = false; @@ -258,6 +259,7 @@ mod test { } #[test] + #[ignore(cfg(windows))] // FIXME #8811 fn read_eof_twice_ip4() { do run_in_newsched_task { let addr = next_test_ip4(); @@ -280,6 +282,7 @@ mod test { } #[test] + #[ignore(cfg(windows))] // FIXME #8811 fn read_eof_twice_ip6() { do run_in_newsched_task { let addr = next_test_ip6(); @@ -302,6 +305,7 @@ mod test { } #[test] + #[ignore(cfg(windows))] // FIXME #8811 fn write_close_ip4() { do run_in_newsched_task { let addr = next_test_ip4(); @@ -331,6 +335,7 @@ mod test { } #[test] + #[ignore(cfg(windows))] // FIXME #8811 fn write_close_ip6() { do run_in_newsched_task { let addr = next_test_ip6(); diff --git a/src/libstd/rt/io/support.rs b/src/libstd/rt/io/support.rs index 7bace5d6df2..afbff77f988 100644 --- a/src/libstd/rt/io/support.rs +++ b/src/libstd/rt/io/support.rs @@ -33,6 +33,7 @@ mod test { use super::PathLike; #[test] + #[ignore(cfg(windows))] // FIXME #8812 fn path_like_smoke_test() { let expected = "/home"; let path = Path(expected); diff --git a/src/libstd/rt/uv/file.rs b/src/libstd/rt/uv/file.rs index 405dfe0a7f0..eaf70242440 100644 --- a/src/libstd/rt/uv/file.rs +++ b/src/libstd/rt/uv/file.rs @@ -408,11 +408,13 @@ mod test { } #[test] + #[ignore(cfg(windows))] // FIXME #8814 fn file_test_full_simple() { file_test_full_simple_impl(); } #[test] + #[ignore(cfg(windows))] // FIXME #8814 fn file_test_full_simple_sync() { file_test_full_simple_impl_sync(); } diff --git a/src/libstd/rt/uv/net.rs b/src/libstd/rt/uv/net.rs index e8d0296e543..3ff6e90e32d 100644 --- a/src/libstd/rt/uv/net.rs +++ b/src/libstd/rt/uv/net.rs @@ -601,6 +601,7 @@ mod test { } #[test] + #[ignore(cfg(windows))] // FIXME #8815 fn listen_ip4() { do run_in_bare_thread() { static MAX: int = 10; @@ -675,6 +676,7 @@ mod test { } #[test] + #[ignore(cfg(windows))] // FIXME #8815 fn listen_ip6() { do run_in_bare_thread() { static MAX: int = 10; @@ -751,6 +753,7 @@ mod test { } #[test] + #[ignore(cfg(windows))] // FIXME #8815 fn udp_recv_ip4() { do run_in_bare_thread() { static MAX: int = 10; @@ -811,6 +814,7 @@ mod test { } #[test] + #[ignore(cfg(windows))] // FIXME #8815 fn udp_recv_ip6() { do run_in_bare_thread() { static MAX: int = 10; diff --git a/src/libstd/rt/uv/uvio.rs b/src/libstd/rt/uv/uvio.rs index e620ab274b1..f282432dcb5 100644 --- a/src/libstd/rt/uv/uvio.rs +++ b/src/libstd/rt/uv/uvio.rs @@ -1666,6 +1666,7 @@ fn test_read_read_read() { } #[test] +#[ignore(cfg(windows))] // FIXME #8816 fn test_udp_twice() { do run_in_newsched_task { let server_addr = next_test_ip4(); @@ -1800,6 +1801,7 @@ fn file_test_uvio_full_simple_impl() { } #[test] +#[ignore(cfg(windows))] // FIXME #8816 fn file_test_uvio_full_simple() { do run_in_newsched_task { file_test_uvio_full_simple_impl(); diff --git a/src/libstd/rt/uv/uvll.rs b/src/libstd/rt/uv/uvll.rs index 1e189e90885..d2e3b4176f9 100644 --- a/src/libstd/rt/uv/uvll.rs +++ b/src/libstd/rt/uv/uvll.rs @@ -227,6 +227,7 @@ fn handle_sanity_check() { } #[test] +#[ignore(cfg(windows))] // FIXME #8817 #[fixed_stack_segment] #[inline(never)] fn request_sanity_check() { diff --git a/src/libstd/unstable/dynamic_lib.rs b/src/libstd/unstable/dynamic_lib.rs index 90cf49cad1c..db106de76d9 100644 --- a/src/libstd/unstable/dynamic_lib.rs +++ b/src/libstd/unstable/dynamic_lib.rs @@ -90,6 +90,7 @@ mod test { use libc; #[test] + #[ignore(cfg(windows))] // FIXME #8818 fn test_loading_cosine() { // The math library does not need to be loaded since it is already // statically linked in