Skip to content

[Proposal] std-powered Clock implementation for tests #112

@ryan-summers

Description

@ryan-summers

Many crates that want an embedded_time::Clock may also want to have integration/unit tests that run on host. Is it possible to expose a std-powered embedded_time::Clock that can be easily used for unit/integration testing for dependent crates?

I'm deriving this idea from the std-embedded-nal, which provides an embedded_nal network stack implementation for std platforms.

I implemented an example of this in an MQTT integration test available at https://github.com/quartiq/minimq/blob/c2b0c41c18288e55dbc65831fdd43fb7419dea17/tests/integration_test.rs#L8-L32

Would such an implementation be desired for embedded-time? Are there any potential limitations of this approach?

An alternative is to take the approach of std-embedded-nal, where the std-powered implementation is distributed as a separate crate.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions