Skip to content

Commit a2ff2d1

Browse files
committed
fix(ci): exclude tests that require a real display
1 parent 96d3f38 commit a2ff2d1

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ jobs:
100100
target
101101
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
102102
- name: cargo test
103-
run: cargo test --all-features --all --locked -- -Z unstable-options
103+
run: cargo test --all --locked -- -Z unstable-options
104104

105105
audit:
106106
name: security audit

Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,6 @@ core-foundation-sys = "0.8"
3535

3636
[target.'cfg(target_os = "linux")'.dependencies]
3737
x11rb = "0.7"
38+
39+
[features]
40+
test_against_real_display = []

src/linux/x11_api.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,7 @@ impl PlatformApi for X11Api {
268268
}
269269
}
270270

271+
#[cfg(feature = "test_against_real_display")]
271272
#[cfg(test)]
272273
mod test {
273274
use super::*;
@@ -315,6 +316,7 @@ mod test {
315316
let win = api.get_active_window()?;
316317
let image = api.capture_window_screenshot(win)?;
317318
let image: View<_, Bgra<u8>> = image.as_view().unwrap();
319+
318320
let Bgra([b, g, r, a]) = image.get_pixel(10, 25);
319321
assert_ne!(b, 0);
320322
assert_ne!(g, 0);

0 commit comments

Comments
 (0)