ArduinoFake breaks building

Hello all,

I have a very strange problem where installing ArduinoFake (via the registry) seems to break the building of my project. Before installing, building works, however after installing it (even without doing any other changes) it seems to make the building process fail with a lot of errors. The only other library I have installed is Unity.

The errors that appear repeatedly during building are:

.pio\libdeps\pico\ArduinoFake\src/fakeit.hpp:5376:9: error: no return statement in function returning non-void [-Werror=return-type]
C:\Users\jamhu\.platformio\packages\framework-arduinopico\libraries\LittleFS\src\LittleFS.h:174:13: error: 'DEBUGV' was not declared in this scope
C:\Users\jamhu\.platformio\packages\framework-arduinopico\libraries\lwIP_Ethernet\src/LwipIntfDev.h:319:14: error: 'class IPAddress' has no member named 'isSet'
C:\Users\jamhu\.platformio\packages\framework-arduinopico\libraries\WiFi\src/WiFiUdp.h:104:5: error: reference to 'IPAddress' is ambiguous
cc1plus.exe: some warnings being treated as errors
*** [.pio\build\pico\src\manager.cpp.o] Error 1
cc1plus.exe: some warnings being treated as errors
*** [.pio\build\pico\lib2d4\lwIP_CYW43\lwIP_CYW43.cpp.o] Error 1
cc1plus.exe: some warnings being treated as errors
*** [.pio\build\pico\liba30\LittleFS\LittleFS.cpp.o] Error 1

Below is my ini file:

[env:pico]
platform = https://github.com/maxgerhardt/platform-raspberrypi
framework = arduino
board = rpipicow
board_build.core = earlephilhower
build_flags = -Iinclude -frtti
lib_deps = fabiobatsilva/ArduinoFake@^0.4.0

Please leave any suggestions if you have any.
Thank you for reading!

…usually you use fabiobatsilva/ArduinoFake@^0.4.0 on platform = native, aka testing mock code on Desktop… You seem to be using it to run on-target unit tests with the Arduino framework mocked, while also requiring the Arduino framework to build a framework. That’s a highly unqiue configuration which I’m pretty sure would break, since ArduinoFake is supplying all the Arduino.h and related headers, which then confuses the regular firmware build.

So I would recommend: Create two environments: One just [env:pico]. You can run onn-target unit test in this environment as you’d like too, with just the Unity framework, no Arduino mocking. The other one being [env:native] for mock tests with Arduino fork.

In any case, lib_deps = fabiobatsilva/ArduinoFake@^0.4.0 should not be in an environment that has framework = arduino. Delete it from there. Delete the .pio folder of the project as well to avoid caching issues, and getting a clean rebuild.

Ah I see I have misunderstood the use of the library. Thanks again max.