2 comments

  • iconara4 days ago
    The [page on testing][1] suggests this:<p>&gt; Where possible, and where it makes sense, you should try to test as much as possible on your host machine, not on the target device.<p>When I have tried this I have encountered multiple problems, first that the Rust test framework requires std, making it convoluted writing test code – but when working around that using conditional compilation, I run into other things like the `esp-hal` depending on crates that won&#x27;t compile on the host.<p>What is the recommended way to test on the host?<p><pre><code> [1]: https:&#x2F;&#x2F;docs.espressif.com&#x2F;projects&#x2F;rust&#x2F;book&#x2F;application-development&#x2F;testing.html</code></pre>
    • bigfishrunning13 minutes ago
      Especially for embedded work (but for regular software too!) I&#x27;ve bought into the &quot;sans-io pattern&quot; for a lot of the software i write anymore<p><a href="https:&#x2F;&#x2F;sans-io.readthedocs.io&#x2F;how-to-sans-io.html" rel="nofollow">https:&#x2F;&#x2F;sans-io.readthedocs.io&#x2F;how-to-sans-io.html</a><p>Keeping all of the actual hardware&#x2F;network&#x2F;io interface code separate really makes writing unit tests and porting to different computers much simpler
    • devmor33 minutes ago
      This is a constant issue for me in every facet of embedded development - with the sole exception of devices that can easily be tested in a qemu environment.<p>I would also love to hear that the authors of this book suggest.
  • jauntywundrkind2 minutes ago
    awesome to see this under espressif.com! that&#x27;s so fantastic.<p>not to the point here, but i wonder what Zephyr would have been like if Rust had been more of a thing at the time. that&#x27;s not really possible, as from my understanding it derived from Wind River Systems&#x27; donated Rocket OS, which i think predates Rust (which is not a new language!). still an interesting what if to me: zephyr seems to be the embedded os with the best wireless support by a country mile, have a lot of companies targeting it (often alas forking it rather than going upstream): it holds my interest the most.