Apprentiship blog

Unit testing in C

November 30, 2018

A large amount of today was absorbed trying to figure out unit testing in C, unfortunately the first frame work I to used cmocka isn’t very well documented, I managed to get the examples from the website to work and that was all I could get to work, the test suite has a lot of features but not much information on how to use them. So after a few hours trying to relate the documentation to what I was trying to test I gave up and moved on to other test frameworks. minunit is short very short, 3 lines of code which was easy to understand and easy to modify. Another test framework I managed to get to work today was criterion which was easy to get working, has a some examples and documentation an added plus is that the out put looks nice.

Aside from the daily kata, and a introduction to the deployment tools and rules here at holidayCheck all I got done to day was testing testing frameworks.

Today’s learning,

How and when to use the linking flags of the c compiler and to limit the amount of time spent trying to get a library or solution to work.


Written by Marc McIntosh Find him on github