diff options
| author | bjorn3 <17426603+bjorn3@users.noreply.github.com> | 2025-01-17 10:25:12 +0000 |
|---|---|---|
| committer | bjorn3 <17426603+bjorn3@users.noreply.github.com> | 2025-01-26 10:28:05 +0000 |
| commit | 332fb7e6f1d3fd4df628a9d772c47e7e0c387e0f (patch) | |
| tree | 0e32be9fda9aecab2bf3ea21cc671c3f32e0001a | |
| parent | 4ce917dfd5182d78c7351092473de1960efc9626 (diff) | |
Move std::thread_local unit tests to integration tests
| -rw-r--r-- | library/std/Cargo.toml | 4 | ||||
| -rw-r--r-- | library/std/src/thread/local.rs | 6 | ||||
| -rw-r--r-- | library/std/tests/thread_local/dynamic_tests.rs (renamed from library/std/src/thread/local/dynamic_tests.rs) | 6 | ||||
| -rw-r--r-- | library/std/tests/thread_local/lib.rs | 4 | ||||
| -rw-r--r-- | library/std/tests/thread_local/tests.rs (renamed from library/std/src/thread/local/tests.rs) | 10 |
5 files changed, 16 insertions, 14 deletions
diff --git a/library/std/Cargo.toml b/library/std/Cargo.toml index 9c1b04b2742..be6c2aad871 100644 --- a/library/std/Cargo.toml +++ b/library/std/Cargo.toml @@ -134,6 +134,10 @@ harness = false name = "floats" path = "tests/floats/lib.rs" +[[test]] +name = "thread_local" +path = "tests/thread_local/lib.rs" + [[bench]] name = "stdbenches" path = "benches/lib.rs" diff --git a/library/std/src/thread/local.rs b/library/std/src/thread/local.rs index c003503ca8b..ca04aa4ada4 100644 --- a/library/std/src/thread/local.rs +++ b/library/std/src/thread/local.rs @@ -2,12 +2,6 @@ #![unstable(feature = "thread_local_internals", issue = "none")] -#[cfg(all(test, not(any(target_os = "emscripten", target_os = "wasi"))))] -mod tests; - -#[cfg(test)] -mod dynamic_tests; - use crate::cell::{Cell, RefCell}; use crate::error::Error; use crate::fmt; diff --git a/library/std/src/thread/local/dynamic_tests.rs b/library/std/tests/thread_local/dynamic_tests.rs index dd180041648..454462b3925 100644 --- a/library/std/src/thread/local/dynamic_tests.rs +++ b/library/std/tests/thread_local/dynamic_tests.rs @@ -1,6 +1,6 @@ -use crate::cell::RefCell; -use crate::collections::HashMap; -use crate::thread_local; +use std::cell::RefCell; +use std::collections::HashMap; +use std::thread_local; #[test] fn smoke() { diff --git a/library/std/tests/thread_local/lib.rs b/library/std/tests/thread_local/lib.rs new file mode 100644 index 00000000000..c5291435425 --- /dev/null +++ b/library/std/tests/thread_local/lib.rs @@ -0,0 +1,4 @@ +#[cfg(not(any(target_os = "emscripten", target_os = "wasi")))] +mod tests; + +mod dynamic_tests; diff --git a/library/std/src/thread/local/tests.rs b/library/std/tests/thread_local/tests.rs index 9d4f52a0921..aa020c2559c 100644 --- a/library/std/src/thread/local/tests.rs +++ b/library/std/tests/thread_local/tests.rs @@ -1,8 +1,8 @@ -use crate::cell::{Cell, UnsafeCell}; -use crate::sync::atomic::{AtomicU8, Ordering}; -use crate::sync::{Arc, Condvar, Mutex}; -use crate::thread::{self, Builder, LocalKey}; -use crate::thread_local; +use std::cell::{Cell, UnsafeCell}; +use std::sync::atomic::{AtomicU8, Ordering}; +use std::sync::{Arc, Condvar, Mutex}; +use std::thread::{self, Builder, LocalKey}; +use std::thread_local; #[derive(Clone, Default)] struct Signal(Arc<(Mutex<bool>, Condvar)>); |
