-
Notifications
You must be signed in to change notification settings - Fork 13.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move std::sync unit tests to integration tests
This removes two minor OnceLock tests which test private methods. The rest of the tests should be more than enough to catch mistakes in those private methods. Also makes ReentrantLock::try_lock public. And finally it makes the mpmc tests actually run.
- Loading branch information
Showing
22 changed files
with
101 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -676,6 +676,3 @@ unsafe impl<#[may_dangle] T> Drop for OnceLock<T> { | |
} | ||
} | ||
} | ||
|
||
#[cfg(test)] | ||
mod tests; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
library/std/src/sync/barrier/tests.rs → library/std/tests/sync/barrier.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 5 additions & 5 deletions
10
library/std/src/sync/poison/condvar/tests.rs → library/std/tests/sync/condvar.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#![feature(lazy_get)] | ||
#![feature(mapped_lock_guards)] | ||
#![feature(mpmc_channel)] | ||
#![feature(once_cell_try)] | ||
#![feature(once_wait)] | ||
#![feature(lock_value_accessors)] | ||
#![feature(reentrant_lock)] | ||
#![feature(rwlock_downgrade)] | ||
#![feature(std_internals)] | ||
#![allow(internal_features)] | ||
|
||
mod barrier; | ||
mod condvar; | ||
mod lazy_lock; | ||
#[cfg(not(any(target_os = "emscripten", target_os = "wasi")))] | ||
mod mpmc; | ||
#[cfg(not(any(target_os = "emscripten", target_os = "wasi")))] | ||
mod mpsc; | ||
#[cfg(not(any(target_os = "emscripten", target_os = "wasi")))] | ||
mod mpsc_sync; | ||
#[cfg(not(any(target_os = "emscripten", target_os = "wasi")))] | ||
mod mutex; | ||
#[cfg(not(any(target_os = "emscripten", target_os = "wasi")))] | ||
mod once; | ||
mod once_lock; | ||
#[cfg(not(any(target_os = "emscripten", target_os = "wasi")))] | ||
mod reentrant_lock; | ||
#[cfg(not(any(target_os = "emscripten", target_os = "wasi")))] | ||
mod rwlock; | ||
|
||
#[path = "../common/mod.rs"] | ||
mod common; |
5 changes: 3 additions & 2 deletions
5
library/std/src/sync/mpmc/tests.rs → library/std/tests/sync/mpmc.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 3 additions & 2 deletions
5
library/std/src/sync/mpsc/tests.rs → library/std/tests/sync/mpsc.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 5 additions & 4 deletions
9
library/std/src/sync/mpsc/sync_tests.rs → library/std/tests/sync/mpsc_sync.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 7 additions & 7 deletions
14
library/std/src/sync/poison/mutex/tests.rs → library/std/tests/sync/mutex.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 6 additions & 6 deletions
12
library/std/src/sync/poison/once/tests.rs → library/std/tests/sync/once.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 3 additions & 4 deletions
7
library/std/src/sync/reentrant_lock/tests.rs → library/std/tests/sync/reentrant_lock.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters