Tuesday, March 27, 2012

unity, cmock and ceedling

This could be the first post about how I am using a unit testing framework that uses the mock concept.

Some background, I was researching some information on the best way to deploy a unit testing framework for embedded work. I started by posting a question on the programmers.stackexchange.com. The answers led me to investigate the solutions provided by Atomic Embedded, namely unity, cmock and ceedling.

Each of the tool by itself will provide some value of unit testing for you, but for embedded work and to help manage all the infrastructure, all the three tools need to be present.

unity is a bunch of macros that performs the tests that determines if the results are correct. 

cmock provides an intelligent parser and framework that mocks the underlying code. So for all the functions that you use, cmock would be your friend.

ceedling is like the glue that holds unity and cmock together. It is a bunch of ruby scripts the parses your code that is being tested and generates the calls to cmock, generates the test runners and builds the unit test executables.

The Atomic Embedded folks also have CException but I haven't investigate this option.

No comments: