Skip to content

test: fix doctest compilation on macos #92

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

Merged
merged 2 commits into from
Jul 30, 2025
Merged
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
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
strategy:
matrix:
rust: [stable, 1.65.0]
TARGET: [x86_64-apple-darwin]
TARGET: [x86_64-apple-darwin, aarch64-apple-darwin]

steps:
- uses: actions/checkout@v3
Expand All @@ -64,3 +64,4 @@ jobs:
target: ${{ matrix.TARGET }}

- run: cargo build --target=${{ matrix.TARGET }}
- run: cargo test --target=${{ matrix.TARGET }}
6 changes: 6 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,13 @@
//! use std::time::Duration;
//!
//! use i2cdev::core::*;
//! #[cfg(any(target_os = "linux", target_os = "android"))]
//! use i2cdev::linux::{LinuxI2CDevice, LinuxI2CError};
//!
//! const NUNCHUCK_SLAVE_ADDR: u16 = 0x52;
//!
//! // real code should probably not use unwrap()
//! #[cfg(any(target_os = "linux", target_os = "android"))]
//! fn i2cfun() -> Result<(), LinuxI2CError> {
//! let mut dev = LinuxI2CDevice::new("/dev/i2c-1", NUNCHUCK_SLAVE_ADDR)?;
//!
Expand All @@ -52,10 +54,12 @@
//! extern crate i2cdev;
//!
//! use i2cdev::core::*;
//! #[cfg(any(target_os = "linux", target_os = "android"))]
//! use i2cdev::linux::{LinuxI2CDevice, LinuxI2CError, LinuxI2CMessage};
//!
//! const SLAVE_ADDR: u16 = 0x57;
//!
//! #[cfg(any(target_os = "linux", target_os = "android"))]
//! fn write_read_transaction() -> Result<(), LinuxI2CError> {
//! let mut dev = LinuxI2CDevice::new("/dev/i2c-1", SLAVE_ADDR)?;
//!
Expand All @@ -76,10 +80,12 @@
//! extern crate i2cdev;
//!
//! use i2cdev::core::*;
//! #[cfg(any(target_os = "linux", target_os = "android"))]
//! use i2cdev::linux::{LinuxI2CBus, LinuxI2CError, LinuxI2CMessage};
//!
//! const SLAVE_ADDR: u16 = 0x57;
//!
//! #[cfg(any(target_os = "linux", target_os = "android"))]
//! fn write_read_transaction_using_bus() -> Result<(), LinuxI2CError> {
//! let mut dev = LinuxI2CBus::new("/dev/i2c-1")?;
//!
Expand Down