Skip to content

CI: Use libMainThreadChecker to test if all functions run on the correct thread #418

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,16 @@ jobs:
if: runner.os == 'macOS'
run: brew install --cask firefox

- name: Verify Loaded Libraries
run: otool -L /Applications/Xcode.app/Contents/Developer/usr/lib/libMainThreadChecker.dylib


- name: Run integration tests in release mode
if: matrix.features != 'wayland' && matrix.features != 'libei' && matrix.features != 'libei,wayland,xdo,x11rb' # On Linux, the integration tests only work with X11 for now
run: cargo test integration --release --no-default-features --features ${{ matrix.features }} -- --test-threads=1 --nocapture --include-ignored
env:
DYLD_INSERT_LIBRARIES: /Applications/Xcode.app/Contents/Developer/usr/lib/libMainThreadChecker.dylib
MTC_RESET_INSERT_LIBRARIES: 0

- name: Take screenshot
if: always()
Expand All @@ -88,3 +95,4 @@ jobs:
platform: ${{ matrix.platform }}
rust: ${{ matrix.rust }}
feature: ${{ matrix.features }}

4 changes: 4 additions & 0 deletions tests/integration_browser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ use common::enigo_test::EnigoTest as Enigo;

#[test]
fn integration_browser_events() {
println!(
"DYLD_INSERT_LIBRARIES={:?}",
std::env::var("DYLD_INSERT_LIBRARIES")
);
let mut enigo = Enigo::new(&Settings::default());

enigo.text("TestText❤️").unwrap();
Expand Down
Loading