Description
Issue Summary
During compiling the unit tests, arduino_ci
compiles all *.c*
files of the library.
But it uses not the platform specific dependencies. Since the unit tests should run on system running arduino_ci
this sounds clear. But its not; the source code was written for the specified arduino system and at most time can not be build on a system running arduino_ci
.
Arduino or Unit Test Code, Illustrating the Problem
As example I used Udp.h
for the platform zero in the source code of the library. So the unit tests cannot be compiled.
Since I'm writing the code I'm free to split it. Some parts could be tested -- e. g. macros running on linux systems,
which could be stored in separated header files.
So, I see a few solutions:
- Add to
arduino_ci
the possibility to skip some files during building unit tests. - Add to
arduino_ci
the possibility to add custom code to mock some libraries or at least to mock some header files of used libraries. - Add documentation how to add custom code to mock something.
I'm not sure if adding mocked header files to /var/lib/gems/*/gems/arduino_ci-*/cpp/arduino/
or /var/lib/gems/*/bundler/gems/arduino_ci-*/cpp/arduino/
is the right way. But it works. ?
Arduino Architecture(s) Affected
all