Skip to content
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

Stubbing? #27

Open
Aehmlo opened this issue Apr 10, 2019 · 5 comments
Open

Stubbing? #27

Aehmlo opened this issue Apr 10, 2019 · 5 comments
Assignees

Comments

@Aehmlo
Copy link
Contributor

Aehmlo commented Apr 10, 2019

I'd like to be able to enable a stub feature (or whatever) and be able to use rppal GPIO functions on CI (which obviously isn't a Raspberry Pi). I currently implement this myself, but it'd be great to have this capability upstream (and thereby reduce the surface area of my own code).

@golemparts
Copy link
Owner

Thanks for the suggestion! Mocking the various peripherals in software has crossed my mind as well, since it would allow me to finally add somewhat meaningful tests. I've held off on working on it so far, because rppal wasn't feature-complete until recently. Now that I've finished adding support for the final peripheral (UART), adding mocking for all peripherals through a feature flag would fit nicely on the roadmap to v1.0.0. I'll add it to the feature request list as something to work on after the upcoming 0.11.2 release.

@golemparts golemparts self-assigned this Apr 10, 2019
@Aehmlo
Copy link
Contributor Author

Aehmlo commented Apr 10, 2019

If you'd like a hand with it, I'd be happy to help out!

@golemparts
Copy link
Owner

Thanks, I appreciate the offer! I'm not quite ready to dive into this right now, but I would like to consider the relevant implementation details beforehand to keep them consistent across all peripherals, especially with the large amount of changes required throughout the entire project, so I'll hold off on asking for PRs for now. I'll definitely contact you if I need a hand when this moves to active development, or to discuss the proposed implementation.

@JohnRudolfLewis
Copy link

Any update on this? I would really like to write unit tests for my code that uses Gpio and other parts of rppal.

@ryankurte
Copy link

Hey, it's not directly rppal / doesn't cover all of rppal, however, where you're consuming embedded-hal traits implemented / exposed by rppal you may find dbrgn/embedded-hal-mock useful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants