How can I unit test Arduino code?

后端 未结 20 807
情深已故
情深已故 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:14

    There is a project called ncore, which provides native core for Arduino. And allows you to write tests for Arduino code.

    From the project description

    The native core allows you to compile and run Arduino sketches on the PC, generally with no modification. It provides native versions of standard Arduino functions, and a command-line interepreter to give inputs to your sketch that would normally come from the hardware itself.

    Also on the "what do I need to use it" section

    If you want to build the tests, you'll need cxxtest from http://cxxtest.tigris.org. NCORE has been tested with cxxtest 3.10.1.

提交回复
热议问题