Skip to content

Need to emulate a serial device for standard unit testing #2

@alextoind

Description

@alextoind

Some unit tests can be developed by mocking low level functions or similar approaches, while the others could be executed with always a real device connected (or no device at all to reproduce only that specific behavior).

However, an emulated serial port would be a more standard way to test the code, even if this imply a cross-platform emulation.

After a very brief glance, this Linux library seems well supported and I could give it a chance: https://github.com/martinpitt/umockdev. If this would be really helpful I should find something similar for Windows and macOS.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesttestingSomething involves CI/CD and testing in general

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions