FabioBatSilva / ArduinoFake

Arduino mocking made easy
https://platformio.org/lib/show/1689/ArduinoFake
MIT License
102 stars 47 forks source link

Add missing Wire.h header for WireFake.h #29

Closed M4a1x closed 2 years ago

M4a1x commented 2 years ago

Hey there, great project!

I struggled to get my library completely independent from the Arduino framework as I didn't want to use virtualization. Therefore using ArduinoFake for a "Link Seam" approach seemed the right choice, as I didn't want to alter my source too much. That worked flawlessly with the Arduino functions - great!

I noticed that for the standard Arduino.h header there is a header that #include "ArduinoFake.h" and thus makes the whole

#ifdef UNIT_TEST
#include <ArduinoFake.h>
#else
#include <Arduino.h>
#endif

shenanigans inside my library superfluous (as in the mock-injection example as opposed to the wiring-blink example). To make the same thing work for the new WireFake.h I added a Wire.h that just includes the fake.

I hope this small addition is fine like this - it seems to be working for me. Please tell me if there's anything else I should add/edit.

Cheers, Max

FabioBatSilva commented 2 years ago

Thanks @M4a1x :+1: