FabioBatSilva / ArduinoFake

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

Include the "real" files instead of the Fakes #42

Closed wrong-kendall closed 1 year ago

wrong-kendall commented 1 year ago

Doing it this way allows PlatformIO to find the correct include files so that existing libraries still work.

This should address #39.

FabioBatSilva commented 1 year ago

Thanks @wrong-kendall .

Do you know why is this a problem on PlatformIO ?

wrong-kendall commented 1 year ago

I don't really know why but I can tell what happens is that it executes:

g++ -o .pio/build/native/lib91a/protoWire/protoWire.o -c -DPLATFORMIO=60106 -DPIO_UNIT_TESTING -Ilib/protoWire -I.pio/libdeps/native/ArduinoFake/src lib/protoWire/protoWire.cpp

And that fails because the only Wire.h exists in arduino/Wire.h

[13:20:44 03/21/23]: <~/development/fake_includes>$ ls .pio/libdeps/native/ArduinoFake/src/
arduino          ArduinoFake.h  ClientFake.cpp  Client.h        fakeit            FunctionFake.h  PrintFake.h     SerialFake.h    StreamFake.h  WireFake.h
ArduinoFake.cpp  Arduino.h      ClientFake.h    CMakeLists.txt  FunctionFake.cpp  PrintFake.cpp   SerialFake.cpp  StreamFake.cpp  WireFake.cpp
FabioBatSilva commented 1 year ago

Thanks @wrong-kendall :+1: