Skip to content

Commit bd1c153

Browse files
committed
Rename testing framework's segfault to skip
1 parent 8ded218 commit bd1c153

File tree

1 file changed

+9
-12
lines changed

1 file changed

+9
-12
lines changed

wgpu/tests/common/mod.rs

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ pub struct FailureCase {
7575
backends: Option<wgpu::Backends>,
7676
vendor: Option<usize>,
7777
adapter: Option<String>,
78-
segfault: bool,
78+
skip: bool,
7979
}
8080

8181
// This information determines if a test should run.
@@ -137,7 +137,7 @@ impl TestParameters {
137137
backends: None,
138138
vendor: None,
139139
adapter: None,
140-
segfault: false,
140+
skip: false,
141141
});
142142
self
143143
}
@@ -148,7 +148,7 @@ impl TestParameters {
148148
backends: Some(backends),
149149
vendor: None,
150150
adapter: None,
151-
segfault: false,
151+
skip: false,
152152
});
153153
self
154154
}
@@ -165,13 +165,13 @@ impl TestParameters {
165165
backends: Option<Backends>,
166166
vendor: Option<usize>,
167167
device: Option<&'static str>,
168-
segfault: bool,
168+
skip: bool,
169169
) -> Self {
170170
self.failures.push(FailureCase {
171171
backends,
172172
vendor,
173173
adapter: device.as_ref().map(AsRef::as_ref).map(str::to_lowercase),
174-
segfault,
174+
skip,
175175
});
176176
self
177177
}
@@ -257,7 +257,7 @@ pub fn initialize_test(parameters: TestParameters, test_function: impl FnOnce(Te
257257
&& expect_failure_adapter.unwrap_or(true)
258258
{
259259
if always {
260-
Some((FailureReasons::ALWAYS, failure.segfault))
260+
Some((FailureReasons::ALWAYS, failure.skip))
261261
} else {
262262
let mut reason = FailureReasons::empty();
263263
reason.set(
@@ -272,18 +272,15 @@ pub fn initialize_test(parameters: TestParameters, test_function: impl FnOnce(Te
272272
FailureReasons::ADAPTER,
273273
expect_failure_adapter.unwrap_or(false),
274274
);
275-
Some((reason, failure.segfault))
275+
Some((reason, failure.skip))
276276
}
277277
} else {
278278
None
279279
}
280280
});
281281

282282
if let Some((reason, true)) = failure_reason {
283-
println!(
284-
"EXPECTED TEST FAILURE SKIPPED DUE TO SEGFAULT: {:?}",
285-
reason
286-
);
283+
println!("EXPECTED TEST FAILURE SKIPPED: {:?}", reason);
287284
return;
288285
}
289286

@@ -297,7 +294,7 @@ pub fn initialize_test(parameters: TestParameters, test_function: impl FnOnce(Te
297294
// Print out reason for the failure
298295
println!("GOT EXPECTED TEST FAILURE: {:?}", reason);
299296
}
300-
} else if let Some(reason) = failure_reason {
297+
} else if let Some((reason, _)) = failure_reason {
301298
// We expected to fail, but things passed
302299
panic!("UNEXPECTED TEST PASS: {:?}", reason);
303300
} else {

0 commit comments

Comments
 (0)