Comments

Hacker News

The [page on testing][1] suggests this:

> 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.

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't compile on the host.

What is the recommended way to test on the host?

  [1]: https://docs.espressif.com/projects/rust/book/application-development/testing.html

by iconara

Join the discussion

Write your take first — we'll ask for email only when you're ready to publish.

  • Hacker News
  • The [page on testing][1] suggests this:

    > 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.

    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't compile on the host.

    What is the recommended way to test on the host?

      [1]: https://docs.espressif.com/projects/rust/book/application-development/testing.html
The Rust on ESP Book · Birbla