SwampFlux / tri-plus-ger

Alternative firmware for Qu-Bit Tri-ger
GNU General Public License v3.0
3 stars 0 forks source link

Unit Test Some Things #6

Open wraybowling opened 4 years ago

wraybowling commented 4 years ago

The grid and the clock code are becoming very complex. It would be good to write some unit tests so I know that it's actually doing what it's supposed to do instead of manipulating the main.cpp program or taking over the blinking LEDs all the time

wraybowling commented 4 years ago

I tried to understand the PIO testing stuff last week and it never worked right. There are some examples in the repo now, but it's not wired up because the tests fail on stupid things. For example, the Tri-ger does not have Serial so I cannot use Serial debugging. Fine. Can I just test the pure C++ functions? In theory, yes, but in practice no. It seems different libraries are imported in the "desktop environment" so that the tests can't even build properly, usually complaining about trying to import Arduino.h or some other standard library that works just fine when I build for the embedded hardware. There are forums where folks bump into similar problems but are harassed by neckbeards that utter the least helpful words in the history of forum replies ever "why would you ever want to do X?" So for the moment, I think that I will not worry about unit testing. It would have been really really helpful in debugging all of that very complicated clock code, all the grid stuff, all the memory problems I was trying to solve for days... But those ships have sailed now. No thanks to PIO's Unit Testing. :|