Skip to content

Commit

Permalink
Unrolled build for rust-lang#130723
Browse files Browse the repository at this point in the history
Rollup merge of rust-lang#130723 - D0liphin:master, r=workingjubilee

Add test for `available_parallelism()`

This is a redo of [this PR](rust-lang#104095).

I changed the location of the test as per comments in the original thread. Otherwise the test is practically the same.

try-job: test-various
  • Loading branch information
rust-timer authored Sep 23, 2024
2 parents 66b0b29 + e9b0bc9 commit ec3e990
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions library/std/tests/thread.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,21 @@ 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_attr(
any(
target_os = "redox",
target_os = "l4re",
target_env = "sgx",
target_os = "solid_asp3",
target_os = "teeos",
target_os = "wasi"
),
should_panic
)]
fn available_parallelism() {
// check that std::thread::available_parallelism() returns a valid value
assert!(thread::available_parallelism().is_ok());
}

0 comments on commit ec3e990

Please sign in to comment.