diff --git a/tests/stdtests.rs b/tests/stdtests.rs new file mode 100644 index 0000000..229a364 --- /dev/null +++ b/tests/stdtests.rs @@ -0,0 +1,50 @@ +#![feature(cfg_target_has_atomic)] +#![feature(const_ip)] +#![feature(const_ipv4)] +#![feature(const_ipv6)] +#![feature(core_io_borrowed_buf)] +#![feature(duration_constants)] +#![feature(io_error_uncategorized)] +#![feature(ip)] +#![feature(lazy_cell)] +#![feature(maybe_uninit_uninit_array)] +#![feature(once_cell_try)] +#![feature(read_buf)] +#![feature(tcp_linger)] +#![feature(try_blocks)] + +extern crate eyra; + +mod stdtests { + mod common; + mod net; + mod sys_common; + + mod env; + mod fs; + mod integration_create_dir_all_bare; + mod integration_env; + mod integration_thread; + mod kernel_copy; + mod lazy; + mod net_addr; + mod net_ip; + mod net_tcp; + mod net_udp; + mod panic; + mod process; + mod process_common; + mod process_unix; + mod sync_barrier; + mod sync_condvar; + mod sync_lazy_lock; + mod sync_mpsc; + mod sync_mpsc_sync; + mod sync_mutex; + mod sync_once; + mod sync_once_lock; + mod sync_rwlock; + mod thread; + mod thread_local; + mod time; +} diff --git a/tests/common/mod.rs b/tests/stdtests/common/mod.rs similarity index 100% rename from tests/common/mod.rs rename to tests/stdtests/common/mod.rs diff --git a/tests/env.rs b/tests/stdtests/env.rs similarity index 99% rename from tests/env.rs rename to tests/stdtests/env.rs index b4b8464..a24212d 100644 --- a/tests/env.rs +++ b/tests/stdtests/env.rs @@ -2,8 +2,6 @@ //! library/std/src/env/tests.rs at revision //! 497ee321af3b8496eaccd7af7b437f18bab81abf. -extern crate eyra; - use std::env::*; use std::path::Path; diff --git a/tests/fs.rs b/tests/stdtests/fs.rs similarity index 99% rename from tests/fs.rs rename to tests/stdtests/fs.rs index 341f827..4f14bfd 100644 --- a/tests/fs.rs +++ b/tests/stdtests/fs.rs @@ -2,17 +2,9 @@ //! library/std/src/fs/tests.rs at revision //! defa2456246a8272ceace9c1cdccdf2e4c36175e. -#![feature(io_error_uncategorized)] -#![feature(read_buf)] -#![feature(maybe_uninit_uninit_array)] -#![feature(core_io_borrowed_buf)] - -extern crate eyra; - -mod sys_common; - use std::io::prelude::*; +use super::sys_common::io::test::{tmpdir, TempDir}; use std::env; use std::fs::{self, File, OpenOptions}; use std::io::{BorrowedBuf, ErrorKind, SeekFrom}; @@ -22,7 +14,6 @@ use std::str; use std::sync::Arc; use std::thread; use std::time::{Duration, Instant}; -use sys_common::io::test::{tmpdir, TempDir}; use rand::{rngs::StdRng, RngCore, SeedableRng}; diff --git a/tests/integration-create_dir_all_bare.rs b/tests/stdtests/integration_create_dir_all_bare.rs similarity index 97% rename from tests/integration-create_dir_all_bare.rs rename to tests/stdtests/integration_create_dir_all_bare.rs index 067782f..9171d6d 100644 --- a/tests/integration-create_dir_all_bare.rs +++ b/tests/stdtests/integration_create_dir_all_bare.rs @@ -7,13 +7,11 @@ //! Note that this test changes the current directory so //! should not be in the same process as other tests. -extern crate eyra; - use std::env; use std::fs; use std::path::{Path, PathBuf}; -mod common; +use super::common; // On some platforms, setting the current directory will prevent deleting it. // So this helper ensures the current directory is reset. diff --git a/tests/integration-env.rs b/tests/stdtests/integration_env.rs similarity index 98% rename from tests/integration-env.rs rename to tests/stdtests/integration_env.rs index 88cc45b..3e2fd8a 100644 --- a/tests/integration-env.rs +++ b/tests/stdtests/integration_env.rs @@ -2,15 +2,12 @@ //! library/std/tests/env.rs at revision //! 9b18b4440a8d8b052ef454dba9fdb95be99485e7. -extern crate eyra; - use std::env::*; use std::ffi::{OsStr, OsString}; use rand::distributions::{Alphanumeric, DistString}; -mod common; -use common::test_rng; +use super::common::test_rng; #[track_caller] fn make_rand_name() -> OsString { diff --git a/tests/integration-thread.rs b/tests/stdtests/integration_thread.rs similarity index 96% rename from tests/integration-thread.rs rename to tests/stdtests/integration_thread.rs index aec4035..9091b74 100644 --- a/tests/integration-thread.rs +++ b/tests/stdtests/integration_thread.rs @@ -2,8 +2,6 @@ //! library/std/tests/thread.rs at revision //! 9b18b4440a8d8b052ef454dba9fdb95be99485e7. -extern crate eyra; - use std::sync::{Arc, Mutex}; use std::thread; use std::time::Duration; diff --git a/tests/kernel_copy.rs b/tests/stdtests/kernel_copy.rs similarity index 98% rename from tests/kernel_copy.rs rename to tests/stdtests/kernel_copy.rs index 70ea1d2..3fc50d9 100644 --- a/tests/kernel_copy.rs +++ b/tests/stdtests/kernel_copy.rs @@ -2,12 +2,7 @@ //! library/std/src/sys/unix/kernel_copy/tests.rs at revision //! 5c0d76dbe1669c96f1959d7b0b1d4de7e9a47c43. -#![feature(try_blocks)] - -extern crate eyra; - -mod sys_common; - +use super::sys_common::io::test::tmpdir; use std::fs::OpenOptions; #[cfg(feature = "bench")] use std::io; @@ -16,7 +11,6 @@ use std::io::SeekFrom; use std::io::{BufRead, Read, Seek, Write}; #[cfg(feature = "bench")] use std::os::unix::io::AsRawFd; -use sys_common::io::test::tmpdir; #[test] fn copy_specialization() -> Result<()> { diff --git a/tests/lazy.rs b/tests/stdtests/lazy.rs similarity index 99% rename from tests/lazy.rs rename to tests/stdtests/lazy.rs index 16b946b..0fd7b78 100644 --- a/tests/lazy.rs +++ b/tests/stdtests/lazy.rs @@ -2,11 +2,6 @@ //! library/std/src/lazy/tests.rs at revision //! 497ee321af3b8496eaccd7af7b437f18bab81abf. -#![feature(once_cell_try)] -#![feature(lazy_cell)] - -extern crate eyra; - use std::{ cell::LazyCell, panic, diff --git a/tests/net/mod.rs b/tests/stdtests/net/mod.rs similarity index 100% rename from tests/net/mod.rs rename to tests/stdtests/net/mod.rs diff --git a/tests/net/test.rs b/tests/stdtests/net/test.rs similarity index 100% rename from tests/net/test.rs rename to tests/stdtests/net/test.rs diff --git a/tests/net-addr.rs b/tests/stdtests/net_addr.rs similarity index 99% rename from tests/net-addr.rs rename to tests/stdtests/net_addr.rs index 242b642..9bbb592 100644 --- a/tests/net-addr.rs +++ b/tests/stdtests/net_addr.rs @@ -2,11 +2,7 @@ //! library/std/src/net/addr/tests.rs at revision //! 497ee321af3b8496eaccd7af7b437f18bab81abf. -extern crate eyra; - -mod net; - -use crate::net::test::{sa4, sa6, tsa}; +use super::net::test::{sa4, sa6, tsa}; use std::net::*; #[test] diff --git a/tests/net-ip.rs b/tests/stdtests/net_ip.rs similarity index 99% rename from tests/net-ip.rs rename to tests/stdtests/net_ip.rs index 900e6ea..d32a7c0 100644 --- a/tests/net-ip.rs +++ b/tests/stdtests/net_ip.rs @@ -2,16 +2,7 @@ //! library/std/src/net/ip/tests.rs at revision //! c1a5ec7faf6c32af2f0aae1af4420e1bb1a3a7fe. -#![feature(ip)] -#![feature(const_ip)] -#![feature(const_ipv4)] -#![feature(const_ipv6)] - -extern crate eyra; - -mod net; - -use crate::net::test::{sa4, sa6, tsa}; +use super::net::test::{sa4, sa6, tsa}; use std::net::*; use std::str::FromStr; diff --git a/tests/net-tcp.rs b/tests/stdtests/net_tcp.rs similarity index 99% rename from tests/net-tcp.rs rename to tests/stdtests/net_tcp.rs index 39c39ae..2cb637f 100644 --- a/tests/net-tcp.rs +++ b/tests/stdtests/net_tcp.rs @@ -2,14 +2,7 @@ //! library/std/src/net/tcp/tests.rs at revision //! 497ee321af3b8496eaccd7af7b437f18bab81abf. -#![feature(io_error_uncategorized)] -#![feature(tcp_linger)] - -extern crate eyra; - -mod net; - -use crate::net::test::{next_test_ip4, next_test_ip6}; +use super::net::test::{next_test_ip4, next_test_ip6}; use std::fmt; use std::io::prelude::*; use std::io::{ErrorKind, IoSlice, IoSliceMut}; diff --git a/tests/net-udp.rs b/tests/stdtests/net_udp.rs similarity index 99% rename from tests/net-udp.rs rename to tests/stdtests/net_udp.rs index 580c355..82b7d21 100644 --- a/tests/net-udp.rs +++ b/tests/stdtests/net_udp.rs @@ -2,11 +2,7 @@ //! library/std/src/net/udp/tests.rs at revision //! 497ee321af3b8496eaccd7af7b437f18bab81abf. -extern crate eyra; - -mod net; - -use crate::net::test::{next_test_ip4, next_test_ip6}; +use super::net::test::{next_test_ip4, next_test_ip6}; use std::io::ErrorKind; use std::net::*; #[cfg(not(windows))] diff --git a/tests/panic.rs b/tests/stdtests/panic.rs similarity index 98% rename from tests/panic.rs rename to tests/stdtests/panic.rs index 42148e4..ab0e097 100644 --- a/tests/panic.rs +++ b/tests/stdtests/panic.rs @@ -4,8 +4,6 @@ #![allow(dead_code)] -extern crate eyra; - use std::cell::RefCell; use std::panic::{AssertUnwindSafe, UnwindSafe}; use std::rc::Rc; diff --git a/tests/process.rs b/tests/stdtests/process.rs similarity index 99% rename from tests/process.rs rename to tests/stdtests/process.rs index dedbe03..a256b3d 100644 --- a/tests/process.rs +++ b/tests/stdtests/process.rs @@ -2,13 +2,6 @@ //! library/std/src/process/tests.rs at revision //! defa2456246a8272ceace9c1cdccdf2e4c36175e. -#![feature(io_error_uncategorized)] -#![feature(read_buf)] -#![feature(maybe_uninit_uninit_array)] -#![feature(core_io_borrowed_buf)] - -extern crate eyra; - use std::io::prelude::*; use std::io::{BorrowedBuf, ErrorKind}; diff --git a/tests/process-common.rs b/tests/stdtests/process_common.rs similarity index 99% rename from tests/process-common.rs rename to tests/stdtests/process_common.rs index 2cbce4c..9d6b58f 100644 --- a/tests/process-common.rs +++ b/tests/stdtests/process_common.rs @@ -2,8 +2,6 @@ //! library/std/src/sys/unix/process/process_common/tests.rs at revision //! a52c79e859142c1cd5c0c5bdb73f16b754e1b98f. -extern crate eyra; - use std::ffi::OsStr; use std::io::{Read, Write}; use std::mem; diff --git a/tests/process-unix.rs b/tests/stdtests/process_unix.rs similarity index 99% rename from tests/process-unix.rs rename to tests/stdtests/process_unix.rs index 45d375c..3542ff2 100644 --- a/tests/process-unix.rs +++ b/tests/stdtests/process_unix.rs @@ -2,8 +2,6 @@ //! library/std/src/sys/unix/process/process_unix/tests.rs at revision //! 0b35f448f8e9f39ed6fc1c494eeb331afba513bc. -extern crate eyra; - use std::os::unix::process::{CommandExt, ExitStatusExt}; use std::panic::catch_unwind; use std::process::Command; diff --git a/tests/sync-barrier.rs b/tests/stdtests/sync_barrier.rs similarity index 98% rename from tests/sync-barrier.rs rename to tests/stdtests/sync_barrier.rs index 266eb99..5d765f5 100644 --- a/tests/sync-barrier.rs +++ b/tests/stdtests/sync_barrier.rs @@ -2,8 +2,6 @@ //! library/std/src/sync/barrier.rs at revision //! 497ee321af3b8496eaccd7af7b437f18bab81abf. -extern crate eyra; - use std::sync::mpsc::{channel, TryRecvError}; use std::sync::{Arc, Barrier}; use std::thread; diff --git a/tests/sync-condvar.rs b/tests/stdtests/sync_condvar.rs similarity index 99% rename from tests/sync-condvar.rs rename to tests/stdtests/sync_condvar.rs index 63eed48..1ccd2ff 100644 --- a/tests/sync-condvar.rs +++ b/tests/stdtests/sync_condvar.rs @@ -2,8 +2,6 @@ //! library/std/src/sync/condvar/tests.rs at revision //! 21c5f780f464b27802d0ee0f86c95eb29881096b. -extern crate eyra; - use std::sync::atomic::{AtomicBool, Ordering}; use std::sync::mpsc::channel; use std::sync::{Arc, Condvar, Mutex}; diff --git a/tests/sync-lazy_lock.rs b/tests/stdtests/sync_lazy_lock.rs similarity index 98% rename from tests/sync-lazy_lock.rs rename to tests/stdtests/sync_lazy_lock.rs index a520fe9..6884098 100644 --- a/tests/sync-lazy_lock.rs +++ b/tests/stdtests/sync_lazy_lock.rs @@ -2,10 +2,6 @@ //! library/std/src/sync/lazy_lock/tests.rs at revision //! c1a2db3372a4d6896744919284f3287650a38ab7. -#![feature(lazy_cell)] - -extern crate eyra; - use std::{ cell::LazyCell, panic, diff --git a/tests/sync-mpsc.rs b/tests/stdtests/sync_mpsc.rs similarity index 99% rename from tests/sync-mpsc.rs rename to tests/stdtests/sync_mpsc.rs index 6d15851..7a19a57 100644 --- a/tests/sync-mpsc.rs +++ b/tests/stdtests/sync_mpsc.rs @@ -2,8 +2,6 @@ //! library/std/src/sync/mpsc/tests.rs at revision //! 5fd561dea24d137734195d8d2dc82fe179553b2d. -extern crate eyra; - use std::env; use std::sync::mpsc::*; use std::thread; diff --git a/tests/sync-mpsc-sync.rs b/tests/stdtests/sync_mpsc_sync.rs similarity index 99% rename from tests/sync-mpsc-sync.rs rename to tests/stdtests/sync_mpsc_sync.rs index efb6d88..3b12fc7 100644 --- a/tests/sync-mpsc-sync.rs +++ b/tests/stdtests/sync_mpsc_sync.rs @@ -2,8 +2,6 @@ //! library/std/src/sync/mpsc/sync_tests.rs at revision //! 5fd561dea24d137734195d8d2dc82fe179553b2d. -extern crate eyra; - use std::env; use std::sync::mpsc::*; use std::thread; diff --git a/tests/sync-mutex.rs b/tests/stdtests/sync_mutex.rs similarity index 99% rename from tests/sync-mutex.rs rename to tests/stdtests/sync_mutex.rs index e6bb17c..a292854 100644 --- a/tests/sync-mutex.rs +++ b/tests/stdtests/sync_mutex.rs @@ -2,8 +2,6 @@ //! library/std/src/sync/mutex/tests.rs at revision //! 72a25d05bf1a4b155d74139ef700ff93af6d8e22. -extern crate eyra; - use std::sync::atomic::{AtomicUsize, Ordering}; use std::sync::mpsc::channel; use std::sync::Condvar; diff --git a/tests/sync-once.rs b/tests/stdtests/sync_once.rs similarity index 99% rename from tests/sync-once.rs rename to tests/stdtests/sync_once.rs index be7b573..2fc92e7 100644 --- a/tests/sync-once.rs +++ b/tests/stdtests/sync_once.rs @@ -2,8 +2,6 @@ //! library/std/src/sync/once/tests.rs at revision //! f42e96149dd03e816b8bc3c329e7b9a5d12fcdab. -extern crate eyra; - use std::panic; use std::sync::mpsc::channel; use std::sync::Once; diff --git a/tests/sync-once_lock.rs b/tests/stdtests/sync_once_lock.rs similarity index 99% rename from tests/sync-once_lock.rs rename to tests/stdtests/sync_once_lock.rs index 3857f28..b35d54e 100644 --- a/tests/sync-once_lock.rs +++ b/tests/stdtests/sync_once_lock.rs @@ -2,10 +2,6 @@ //! library/std/src/sync/once_lock/tests.rs at revision //! c1a2db3372a4d6896744919284f3287650a38ab7. -#![feature(once_cell_try)] - -extern crate eyra; - use std::{ panic, sync::OnceLock, diff --git a/tests/sync-rwlock.rs b/tests/stdtests/sync_rwlock.rs similarity index 99% rename from tests/sync-rwlock.rs rename to tests/stdtests/sync_rwlock.rs index b13a69a..1833585 100644 --- a/tests/sync-rwlock.rs +++ b/tests/stdtests/sync_rwlock.rs @@ -2,8 +2,6 @@ //! library/std/src/sync/rwlock/tests.rs at revision //! 72a25d05bf1a4b155d74139ef700ff93af6d8e22. -extern crate eyra; - use rand::{self, Rng}; use std::sync::atomic::{AtomicUsize, Ordering}; use std::sync::mpsc::channel; diff --git a/tests/sys_common/io.rs b/tests/stdtests/sys_common/io.rs similarity index 100% rename from tests/sys_common/io.rs rename to tests/stdtests/sys_common/io.rs diff --git a/tests/sys_common/mod.rs b/tests/stdtests/sys_common/mod.rs similarity index 100% rename from tests/sys_common/mod.rs rename to tests/stdtests/sys_common/mod.rs diff --git a/tests/thread.rs b/tests/stdtests/thread.rs similarity index 99% rename from tests/thread.rs rename to tests/stdtests/thread.rs index 4b1c54e..448ae79 100644 --- a/tests/thread.rs +++ b/tests/stdtests/thread.rs @@ -2,8 +2,6 @@ //! library/std/src/thread/tests.rs at revision //! eb14dd863a0d8af603c6783b10efff8454944c15. -extern crate eyra; - use std::any::Any; use std::mem; use std::panic::panic_any; diff --git a/tests/thread-local.rs b/tests/stdtests/thread_local.rs similarity index 99% rename from tests/thread-local.rs rename to tests/stdtests/thread_local.rs index 6debd09..9a51082 100644 --- a/tests/thread-local.rs +++ b/tests/stdtests/thread_local.rs @@ -2,8 +2,6 @@ //! library/std/src/thread/local/tests.rs at revision //! 497ee321af3b8496eaccd7af7b437f18bab81abf. -extern crate eyra; - use std::cell::{Cell, UnsafeCell}; use std::sync::atomic::{AtomicU8, Ordering}; use std::sync::mpsc::{channel, Sender}; diff --git a/tests/time.rs b/tests/stdtests/time.rs similarity index 99% rename from tests/time.rs rename to tests/stdtests/time.rs index 5f44770..d4a231d 100644 --- a/tests/time.rs +++ b/tests/stdtests/time.rs @@ -2,12 +2,8 @@ //! library/std/src/time/tests.rs at revision //! 72a25d05bf1a4b155d74139ef700ff93af6d8e22. -#![feature(cfg_target_has_atomic)] -#![feature(duration_constants)] #![allow(soft_unstable)] -extern crate eyra; - use std::time::{Duration, Instant, SystemTime, UNIX_EPOCH}; #[cfg(feature = "bench")] #[cfg(not(target_arch = "wasm32"))]