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

Unit testing? #544

Open
gabevenberg opened this issue Oct 28, 2023 · 1 comment
Open

Unit testing? #544

gabevenberg opened this issue Oct 28, 2023 · 1 comment

Comments

@gabevenberg
Copy link

Ive been expanding the compass a bit at https://github.com/gabevenberg/micro-bit-led-compass, adding things like tilt compensation and more directions than just the 8 using a line drawing algorithm. (in progress).

its gotten to the point where I need to unit test some of my non-hardware dependent functionality. Im not trying to do HIL testing or anything like that, I just want to logically test a few modules that are well separated from the hardware-dependent code. I tried implementing what is suggested in this post, but was not able to get tests working on the separate (no-std) crates. How should I set up unit tests for testing individual modules in embedded projects? Examples would be massively appreciated.

@gabevenberg
Copy link
Author

I did eventually figure it out and documented what I did in https://gabevenberg.com/posts/rustembeddedunittesting/. Im not entirely sure how id fit it into the book, but if there's an interest I can try to make a rough draft.

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

No branches or pull requests

1 participant