netatalk
netatalk copied to clipboard
Create unit tests
We currently have a handful of integration tests for afpd in the test/ subdir, but the coverage is limited, and no code coverage is being tracked.
Ideally, we'd apply something like googletest / googlemock to achieve atomic unit tests with code coverage metrics.
This wikipedia article lists a staggering number of unit test frameworks for C.
gtest/gmock leans heavily into the object oriented syntax of C++, and treats C headers as C++ which has some side effects, so it might not be the most elegant choice for this project.
The standout C-centric frameworks in my eyes are:
- CUnit (2022 fork) https://gitlab.com/cunity/cunit
- cmocka https://github.com/clibs/cmocka
- Unity https://github.com/ThrowTheSwitch/Unity
cmocka is nice for its built-in mocking. Unity is nice for its native Meson support.
Went a different direction and embedded the old afptest testsuite into the CI system. While unit testing is still a good idea, I'm happy with the functional test coverage that we have now.