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

Write Some Unit Tests #26

Open
dkitzman opened this issue Dec 30, 2019 · 2 comments
Open

Write Some Unit Tests #26

dkitzman opened this issue Dec 30, 2019 · 2 comments
Labels

Comments

@dkitzman
Copy link
Contributor

We should write some unit tests to make sure things work how we expect them to. There's a lot of builtin support in rust for this.

@BijanT
Copy link
Contributor

BijanT commented Dec 31, 2019

Do you think the best way to do unit tests is through making a test program that targets a cortex-m device running through QEMU? I'm honestly not sure how unit tests work with embedded software

@dkitzman
Copy link
Contributor Author

I don't think that's necessary. You can simulate all the inputs an outputs to functions if you need to. Like, for setting up the initial stack for a task, you could pass a known pointer in, and then have it do it's thing, and then inspect the memory that was modified by that function to make sure it looks right. Stuff like that. I think for the most part, you don't need to actually run on the hardware to do testing. I think both kinds of testing are useful for different things though.

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

No branches or pull requests

2 participants