rust-embedded / rust-embedded/embedded-hal-mock

Sub-sequences that don't require any ordering

Open
#53 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
146
Forks
29
PR merge metrics
No merged PRs in 30d

Description

Currently the "expectations" list for I2C/SPI bus mocks assert an absolute ordering. This is overly restrictive in some cases and locks the test to the process implementation rather than allowing the actual driver requirements to be encoded

Example

An I2C device initialisation that I have goes something like this

  1. a wakeup/unlock sequence (fixed order)
  2. transfer of configuration (a number of registers in any order)
  3. a sleep/lock sequence (fixed order)

With the current crate version, I'm pretty sure my test would have to encode a fixed ordering of operations for that second step. Allowing an unordered set of transactions to occur instead would be beneficial to encode what I actually want to test

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the expectations list and the I2C/SPI mock APIs described in the issue. Define how fixed-order wakeup and sleep sequences can surround an unordered group of configuration transactions, then add coverage showing that the group accepts any order while the surrounding sequences remain ordered.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
embedded-iot, testing-qa
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.