Skip to content

Commit 21a0b09

Browse files
committed
ignore godot-cell threaded tests in nothreads
1 parent 2fe0368 commit 21a0b09

File tree

4 files changed

+38
-1
lines changed

4 files changed

+38
-1
lines changed

godot-cell/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ homepage = "https://godot-rust.github.io"
1212

1313
[features]
1414
proptest = ["dep:proptest"]
15+
experimental-wasm-nothreads = []
1516

1617
[dependencies]
1718
proptest = { workspace = true, optional = true }

godot-cell/tests/mock/blocking.rs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ impl MyClass {
4040
///
4141
/// This should not cause borrow failures and should not lead to deadlocks.
4242
#[test]
43+
#[cfg_attr(
44+
feature = "experimental-wasm-nothreads",
45+
ignore = "Threading not available"
46+
)]
4347
fn calls_parallel() {
4448
use std::thread;
4549

@@ -72,6 +76,10 @@ fn calls_parallel() {
7276
/// Runs each method several times in a row. This should reduce the non-determinism that comes from
7377
/// scheduling of threads.
7478
#[test]
79+
#[cfg_attr(
80+
feature = "experimental-wasm-nothreads",
81+
ignore = "Threading not available"
82+
)]
7583
fn calls_parallel_many_serial() {
7684
use std::thread;
7785

@@ -106,6 +114,10 @@ fn calls_parallel_many_serial() {
106114
/// Runs all the tests several times. This is different from [`calls_parallel_many_serial`] as that calls the
107115
/// methods like AAA...BBB...CCC..., whereas this interleaves the methods like ABC...ABC...ABC...
108116
#[test]
117+
#[cfg_attr(
118+
feature = "experimental-wasm-nothreads",
119+
ignore = "Threading not available"
120+
)]
109121
fn calls_parallel_many_parallel() {
110122
use std::thread;
111123

@@ -142,6 +154,10 @@ fn calls_parallel_many_parallel() {
142154
/// a) Thread A holds mutable reference AND thread B holds no references.
143155
/// b) One or more threads hold shared references AND thread A holds no references
144156
#[test]
157+
#[cfg_attr(
158+
feature = "experimental-wasm-nothreads",
159+
ignore = "Threading not available"
160+
)]
145161
fn non_blocking_reborrow() {
146162
use std::thread;
147163
let instance_id = MyClass::init();
@@ -172,6 +188,10 @@ fn non_blocking_reborrow() {
172188
/// This verifies that the thread which initialized the `GdCell` does not panic when it attempts to mutably borrow while there is already a
173189
/// shared borrow on an other thread.
174190
#[test]
191+
#[cfg_attr(
192+
feature = "experimental-wasm-nothreads",
193+
ignore = "Threading not available"
194+
)]
175195
fn no_mut_panic_on_main() {
176196
use std::thread;
177197
let instance_id = MyClass::init();

godot-cell/tests/mock/panicking.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ fn all_calls_work() {
5858

5959
/// Run each method both from the main thread and a newly created thread.
6060
#[test]
61+
#[cfg_attr(
62+
feature = "experimental-wasm-nothreads",
63+
ignore = "Threading not available"
64+
)]
6165
fn calls_different_thread() {
6266
use std::thread;
6367

@@ -87,6 +91,10 @@ fn calls_different_thread() {
8791
/// if the first call failed, so then we know the integer was incremented by 0. Otherwise, we at least know
8892
/// the range of values that it can be incremented by.
8993
#[test]
94+
#[cfg_attr(
95+
feature = "experimental-wasm-nothreads",
96+
ignore = "Threading not available"
97+
)]
9098
fn calls_parallel() {
9199
use std::thread;
92100

@@ -121,6 +129,10 @@ fn calls_parallel() {
121129
/// Runs each method several times in a row. This should reduce the non-determinism that comes from
122130
/// scheduling of threads.
123131
#[test]
132+
#[cfg_attr(
133+
feature = "experimental-wasm-nothreads",
134+
ignore = "Threading not available"
135+
)]
124136
fn calls_parallel_many_serial() {
125137
use std::thread;
126138

@@ -157,6 +169,10 @@ fn calls_parallel_many_serial() {
157169
/// Runs all the tests several times. This is different from [`calls_parallel_many_serial`] as that calls the
158170
/// methods like AAA...BBB...CCC..., whereas this interleaves the methods like ABC...ABC...ABC...
159171
#[test]
172+
#[cfg_attr(
173+
feature = "experimental-wasm-nothreads",
174+
ignore = "Threading not available"
175+
)]
160176
fn calls_parallel_many_parallel() {
161177
use std::thread;
162178

godot-core/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ codegen-lazy-fptrs = [
2222
double-precision = ["godot-codegen/double-precision"]
2323
experimental-godot-api = ["godot-codegen/experimental-godot-api"]
2424
experimental-threads = ["godot-ffi/experimental-threads", "godot-codegen/experimental-threads"]
25-
experimental-wasm-nothreads = ["godot-ffi/experimental-wasm-nothreads"]
25+
experimental-wasm-nothreads = ["godot-ffi/experimental-wasm-nothreads", "godot-cell/experimental-wasm-nothreads"]
2626
debug-log = ["godot-ffi/debug-log"]
2727
trace = []
2828

0 commit comments

Comments
 (0)