How can I unit test Arduino code?

后端 未结 20 735
情深已故
情深已故 2020-12-07 06:53

I\'d like to be able to unit test my Arduino code. Ideally, I would be able to run any tests without having to upload the code to the Arduino. What tools or libraries can he

相关标签:
20条回答
  • 2020-12-07 07:38

    James W. Grenning writes great books and this one is about unit testing embedded C code Test Driven Development for Embedded C.

    0 讨论(0)
  • 2020-12-07 07:39

    I am using Searduino when writing Arduino code. Searduino is an Arduino simulator and a development environment (Makefiles, C code ...) that makes it easy to hack in C/C++ using your favorite editor. You can import Arduino sketches and run them in the simulator.

    Screenshot of Searduino 0.8: http://searduino.files.wordpress.com/2014/01/jearduino-0-8.png

    Searduino 0.9 will be released and a video will be recorded as soon as the lasts tests are done .... in a day or two.

    Testing on the simulator is not to be considered as real tests, but it certainly have helped me a lot in finding stupid/logical mistakes (forgetting to do pinMode(xx, OUTPUT), etc.).

    BTW: I am one of the people developing Searduino.

    0 讨论(0)
提交回复
热议问题