AllYarnsAreBeautiful / ayab-firmware

Contains the Arduino Firmware for the AYAB Shield
GNU General Public License v3.0
23 stars 18 forks source link

PacketSerial Needs Mocking For Testing Library #57

Open X-sam opened 1 year ago

X-sam commented 1 year ago

56 disabled tests that expected the old serial library, but we need to migrate PacketSerial to using our mocking strategy.

t0mpr1c3 commented 1 year ago

I'll have a stab at it.

t0mpr1c3 commented 1 year ago

A problem: PacketSerial depends on Stream, which depends on Print, which depends on WString, which happens to define a macro called F. This causes a clash with arduino-mock/Arduino.h which defines a different macro F.

This is the relevant line in the AYAB fork of arduino-mock: https://github.com/AllYarnsAreBeautiful/arduino-mock/blob/e59117bd75d4e3f05f86249f70e8cea356b527ef/include/arduino-mock/Arduino.h#L77C11-L77C11

It might be possible to #undef F somewhere and fix this, but I am tempted to kick this can down the road and live with the 99% coverage.

t0mpr1c3 commented 9 months ago

I have a fix for this, but it's on top of a lot of other changes which are not necessary for v1.0, so I'm going to suggest postponing this issue.