rust-embedded / cortex-m-quickstart

Template to develop bare metal applications for Cortex-M microcontrollers
809 stars 167 forks source link

Add example of writing tests that run on host machine #61

Closed rubberduck203 closed 5 years ago

rubberduck203 commented 5 years ago

It's surprisingly difficult to find an example of how to write tests that run on the host machine when using no_std. This PR adds an example of how to get tests compiling and running when using the quickstart. It's based heavily on this blog. https://os.phil-opp.com/unit-testing/

rubberduck203 commented 5 years ago

@korken89 I updated the docs as best I could. Is that a sufficient explanation of why?

As for the limitations ("what can't be done"), I'm not sure yet. I'm only really beginning to try this out. My first step was to get tests running at all. I'm sure there will be other difficulties that I just haven't run into quite yet.

korken89 commented 5 years ago

Thanks for updating! Good to highlight that it is difficult to have a target in this approach.