SMFSW / Queue

Queue handling library (designed on Arduino)
BSD 3-Clause "New" or "Revised" License
93 stars 20 forks source link

Add unit tests and continuous integration #4

Open scls19fr opened 6 years ago

scls19fr commented 6 years ago

Hello,

I'm considering this library as a dependency for an application. Althought I'd prefer to rely on a library which have unit tests.

You can find some links dealing with continuous integration and Arduino https://github.com/adafruit/travis-ci-arduino https://www.pololu.com/blog/654/continuous-testing-for-arduino-libraries-using-platformio-and-travis-ci (they are using http://platformio.org/ )

Kind regards

PS : see also https://docs.travis-ci.com/user/integration/platformio/

https://github.com/platformio/platformio-remote-unit-testing-example

See also https://github.com/mmurdoch/arduinounit/

and discussion at https://github.com/mmurdoch/arduinounit/issues/63

SMFSW commented 6 years ago

First, thanks for your interest in using Queue library.

I understand your concern about unit tests. To be totally honest, this library is declined in 2 flavors, Cpp & C (the last one being derived from former Queue lib). I have cQueue running every day since almost a year (not on arduino platform though, but still compiled with gcc), and making both libs evolve along with the other. Queue is tested against multiple cores on Arduino platform (AVR, SAM, esp8266 mostly) before release, and I don't plan to integrate more things as I would like to keep these libs as tiny as possible (speaking about sw footprint). They are pretty safe to use for now as long as disabling interrupts if the use requires it (using inside interrupts) following warnings in doxygen comments.

The idea of having unit testing is seducing and as long as it remains free, I'm welcoming it, for this lib, any code I published and future ones! I will investigate on the matter in the next few days (thanks for your links) in my spare time and try to see what I can do about it, starting with this lib. I don't plan any milestone right now, but will update this issue tracking when I'll be able to evaluate the work needed.

Please keep an eye on this issue to get some updates and if you have more things to share about it!

Regards, SMFSW

SMFSW commented 6 years ago

Thanks for your links, it helped me to setup Travis CI more easily on a project.

Basic integration of Travis CI done on Queue library.

scls19fr commented 6 years ago

This issue should probably be reopened since there is currently no real unit tests. Currently we only ensure that this project can be build (after each commit). Using modified examples as unit tests could be considered as a first try.

scls19fr commented 6 years ago

You should keep a track on https://github.com/ianfixes/arduino_ci/issues/42

ianfixes commented 6 years ago

I noticed this issue linked from mine. Interestingly, a Queue implementation was the first real Arduino library I tested with arduino_ci. If you're looking for an example to copy from, it would be here: https://github.com/sdesalas/Arduino-Queue.h/pull/1/files

The .arduino-ci.yaml file in that PR might be problematic on versions after 0.1.7 due to https://github.com/ianfixes/arduino_ci/issues/44.

If you start using this for unit tests, I'll welcome any comments or criticism you have.

scls19fr commented 5 years ago

@ianfixes updated arduino_ci https://github.com/ianfixes/arduino_ci You might have a look