ArduinoFake icon indicating copy to clipboard operation
ArduinoFake copied to clipboard

Failing to 'fakeit::UnexpectedMethodCallException'

Open graial opened this issue 1 year ago • 0 comments

In my attempt to incorporate ArduinoFake into an example project using CppUTest: https://github.com/graial/ArduinoFake-cpputest

I'm now failing to target the source file under test.

Within your wiring-blink example, you manage to mock out the Arduino system calls with ArduinoFake, and then call loop() and setup() from the source file.

This is currently failing for me, probably because of something wrong in CmakeLists.txt

a call to loop() triggers fakeit::UnexpectedMethodCallException rather than the loop() in blink.cpp.

Alternatively, if I try to just link the object, I get a redefinition error.

Do you have any idea how to get cmake to look for loop() in the source file? rather than in ArduinoFake?

Or is there some way to flag the loop() function so that it doesn't get passed to ArduinoFake?

Cheers

graial avatar Mar 29 '24 15:03 graial