Move std::thread_local unit tests to integration tests

This commit is contained in:
bjorn3 2025-01-17 10:25:12 +00:00
parent 4ce917dfd5
commit 332fb7e6f1
5 changed files with 16 additions and 14 deletions

View File

@ -134,6 +134,10 @@ harness = false
name = "floats" name = "floats"
path = "tests/floats/lib.rs" path = "tests/floats/lib.rs"
[[test]]
name = "thread_local"
path = "tests/thread_local/lib.rs"
[[bench]] [[bench]]
name = "stdbenches" name = "stdbenches"
path = "benches/lib.rs" path = "benches/lib.rs"

View File

@ -2,12 +2,6 @@
#![unstable(feature = "thread_local_internals", issue = "none")] #![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::cell::{Cell, RefCell};
use crate::error::Error; use crate::error::Error;
use crate::fmt; use crate::fmt;

View File

@ -1,6 +1,6 @@
use crate::cell::RefCell; use std::cell::RefCell;
use crate::collections::HashMap; use std::collections::HashMap;
use crate::thread_local; use std::thread_local;
#[test] #[test]
fn smoke() { fn smoke() {

View File

@ -0,0 +1,4 @@
#[cfg(not(any(target_os = "emscripten", target_os = "wasi")))]
mod tests;
mod dynamic_tests;

View File

@ -1,8 +1,8 @@
use crate::cell::{Cell, UnsafeCell}; use std::cell::{Cell, UnsafeCell};
use crate::sync::atomic::{AtomicU8, Ordering}; use std::sync::atomic::{AtomicU8, Ordering};
use crate::sync::{Arc, Condvar, Mutex}; use std::sync::{Arc, Condvar, Mutex};
use crate::thread::{self, Builder, LocalKey}; use std::thread::{self, Builder, LocalKey};
use crate::thread_local; use std::thread_local;
#[derive(Clone, Default)] #[derive(Clone, Default)]
struct Signal(Arc<(Mutex<bool>, Condvar)>); struct Signal(Arc<(Mutex<bool>, Condvar)>);