Skip to content

Commit ebf9a47

Browse files
committed
[wgpu-test]: Switch to wgpu_types for locking primitives
1 parent 9fbc944 commit ebf9a47

4 files changed

Lines changed: 6 additions & 7 deletions

File tree

tests/Cargo.toml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ exhaust.workspace = true
6767
futures-lite.workspace = true
6868
libtest-mimic.workspace = true
6969
log.workspace = true
70+
parking_lot = { workspace = true, features = ["deadlock_detection"] }
7071
png.workspace = true
7172
pollster.workspace = true
7273
profiling.workspace = true
@@ -81,7 +82,6 @@ half = { workspace = true, features = ["bytemuck", "std"] }
8182
itertools.workspace = true
8283
image.workspace = true
8384
nanorand.workspace = true
84-
parking_lot.workspace = true
8585
strum = { workspace = true, features = ["derive"] }
8686
trybuild.workspace = true
8787

@@ -90,7 +90,6 @@ trybuild.workspace = true
9090
# Cargo-metadata doesn't compile on wasm due to old cargo-util-schemas dependency.
9191
cargo_metadata.workspace = true
9292
env_logger.workspace = true
93-
parking_lot = { workspace = true, features = ["deadlock_detection"] }
9493
ureq.workspace = true
9594

9695
[target.'cfg(not(any(target_arch = "wasm32", miri)))'.dependencies]
@@ -102,7 +101,6 @@ console_log.workspace = true
102101
wasm-bindgen.workspace = true
103102
wasm-bindgen-futures.workspace = true
104103
web-sys = { workspace = true }
105-
parking_lot = { workspace = true, features = ["deadlock_detection"] }
106104

107105
# Webassembly Dev Dependencies
108106
[target.'cfg(target_arch = "wasm32")'.dev-dependencies]

tests/src/native.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
66
use std::{future::Future, pin::Pin};
77

8-
use parking_lot::Mutex;
8+
use wgpu_types::sync::Mutex;
99

1010
use crate::{
1111
config::GpuTestConfiguration, params::TestInfo, report::AdapterReport, run::execute_test,
@@ -87,7 +87,8 @@ impl NativeTest {
8787
}
8888

8989
#[doc(hidden)]
90-
pub static TEST_LIST: Mutex<Vec<crate::GpuTestConfiguration>> = Mutex::new(Vec::new());
90+
pub static TEST_LIST: Mutex<Vec<crate::GpuTestConfiguration>> =
91+
Mutex::const_new(wgpu_types::sync::RawMutex::new(), Vec::new());
9192

9293
/// Return value for the main function.
9394
pub type MainResult = anyhow::Result<()>;

tests/tests/wgpu-gpu/regression/issue_4024.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use std::sync::Arc;
22

3-
use parking_lot::Mutex;
43
use wgpu_test::{gpu_test, GpuTestConfiguration, GpuTestInitializer, TestParameters};
4+
use wgpu_types::sync::Mutex;
55

66
use wgpu::*;
77

tests/tests/wgpu-validation/api/error_scopes.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use std::{
44
sync::Arc,
55
};
66

7-
use parking_lot::Mutex;
7+
use wgpu_types::sync::Mutex;
88

99
const ERR: &str = "Buffer size 9223372036854775808 is greater than the maximum buffer size";
1010
fn raise_validation_error(device: &wgpu::Device) {

0 commit comments

Comments
 (0)