Arduino-CI / arduino_ci

Unit testing and Continuous Integration (CI) for Arduino libraries, from a Ruby gem
Apache License 2.0
110 stars 34 forks source link

Using the arduino_ci/cpp libraries with avr-gcc #125

Open dolfandringa opened 5 years ago

dolfandringa commented 5 years ago

(Issue Summary / Feature Request)

Is there any chance on getting the Arduino mocking libraries working with avr-gcc? I love the mocking libraries and the arduino_ci project works well with a single library. But for a larger project, I would like to use Arduino-Makefile through Bare-Arduino-Project. That uses avr-gcc to build, flash and test code. Is there any chance the cpp/Arduino and cpp/unittest libraries could be made to work with this setup?

ianfixes commented 5 years ago

Hi @dolfandringa-

It's possible that I don't understand what you're asking, but it sounds like this would be something far outside the scope of this project. My only goal here was to enable unit testing on Arduino libraries, to make it easier for library maintainers to evaluate new contributions -- to enable testing without hardware present.

It looks like the projects you posted provide a way to bundle all of a sketch and its dependencies and have it compile without the aid of the Arduino IDE & package management system. This sort of a setup is intriguing (as I find the Arduino IDE to be quite frustrating to automate), but I'm not immediately sure how I'd handle things like injecting my own main function to do the testing (in place of what the Arduino libraries do for you, delegating setup() and loop() for you to fill in). Not only that, I'm not sure how I'd run unit tests on things like I/O, clock, etc yet somehow reserve some I/O for actually reading back the results (to the system conducting the test).

Is there something here I'm missing?