Skip to content

Commit

Permalink
Add test for available_parallelism()
Browse files Browse the repository at this point in the history
This is a redo of (this PR)[#104095].
  • Loading branch information
Oli Iliffe committed Sep 22, 2024
1 parent 8ed95d1 commit 479607b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions library/std/tests/thread.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,11 @@ fn thread_local_containing_const_statements() {
assert_eq!(CELL.get(), 1);
assert_eq!(REFCELL.take(), 1);
}

#[test]
// Include an ignore list on purpose, so that new platforms don't miss it
#[cfg(not(any(target_os = "vxworks", target_os = "redox", target_os = "l4re")))]
fn available_parallelism() {
// check that std::thread::available_parallelism() returns a valid value
assert!(thread::available_parallelism().is_ok());
}

0 comments on commit 479607b

Please sign in to comment.