Conversation
|
I know toHex isn't the most interesting function to test, but this is just a proof of concept of the idea of unit testing in this project. Unit testing can make it significantly easier and faster to catch bugs, as we can exercise logic on regular desktops and in Github Actions without having to push code to a LoRa device and test it. It also allows maintainers to see immediately in Github Actions if a change caused a regression in tests. I chose toHex just because it's a simple function with no external dependencies, though because it's defined in a file that also includes dependencies on |
7608053 to
d3bde98
Compare
|
@mtlynch can you resolve the conflicts on this one? |
|
testing now :) |
|
@446564 - Sure, just fixed. The first two pulled in some unintended changes from the dev/main branches, but it's fixed now. |
|
@mtlynch ok newb time, haven't run unit tests with pio before and getting an error: edit: I have gcc 14 which supports c++17 but this should be using the pio installed toolchain right? |
With the '^x.y.z' semantics, the version can upgrade out from under us and change dependencies, so this pins to an exact version.
|
@446564 - Yeah, it was my fault. I specified gtest Fixed in b6a3aa1 |
|
it's working now, i don't like the output, it's weird to me. but maybe that's just testing with pio |
|
@446564 - Glad it's working! What's remaining to get this merged? |
|
Have pulled it in, seems to work for me. I agree with @446564 that the output isn't very nice, compared to other testing frameworks. But I'm sure as more tests are added we will just get used to it. |
Adds unit tests for
Utils::toHexusing Google gtest framework and adds automatic unit tests runs on every commit to Github Actions for the repo.