Skip to content
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
10 changes: 10 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,16 @@ jobs:
- name: Run cargo test
run: cargo xtask --deny-warnings --backend ${{ matrix.backend }} test ${{ matrix.package }}

loom-tests:
name: rtic-sync loom tests
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Run cargo test
run: RUSTFLAGS="--cfg loom" cargo test -p rtic-sync --release --lib

# Build documentation, check links
docs:
name: build docs
Expand Down
4 changes: 4 additions & 0 deletions rtic-sync/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ For each category, _Added_, _Changed_, _Fixed_ add new entries at the top!

## [Unreleased]

### Changed

- Add `loom` support.

## v1.3.2 - 2025-03-16

### Fixed
Expand Down
14 changes: 11 additions & 3 deletions rtic-sync/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,23 @@ portable-atomic = { version = "1", default-features = false }
embedded-hal = { version = "1.0.0" }
embedded-hal-async = { version = "1.0.0" }
embedded-hal-bus = { version = "0.2.0", features = ["async"] }

defmt-03 = { package = "defmt", version = "0.3", optional = true }

[dev-dependencies]
cassette = "0.3.0"
static_cell = "2.1.0"
tokio = { version = "1", features = ["rt", "macros", "time"] }

[target.'cfg(not(loom))'.dev-dependencies]
tokio = { version = "1", features = ["rt", "macros", "time"], default-features = false }

[features]
default = []
testing = ["critical-section/std", "rtic-common/testing"]
testing = ["rtic-common/testing"]
defmt-03 = ["dep:defmt-03", "embedded-hal/defmt-03", "embedded-hal-async/defmt-03", "embedded-hal-bus/defmt-03"]

[lints.rust]
unexpected_cfgs = { level = "allow", check-cfg = ['cfg(loom)'] }

[target.'cfg(loom)'.dependencies]
loom = { version = "0.7.2", features = [ "futures" ] }
critical-section = { version = "1", features = [ "restore-state-bool" ] }
1 change: 1 addition & 0 deletions rtic-sync/src/arbiter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,7 @@ pub mod i2c {
}
}

#[cfg(not(loom))]
#[cfg(test)]
mod tests {
use super::*;
Expand Down
Loading
Loading