1 Comment

Announcement: Unity and CMock 2.0

I’m reposting here an announcement authored by Mark VanderVoord for the AgileEmbedded list. We are announcing major updates to two of the C testing tools that Mark and several of us at AO have been developing for a number of years now. These C testing tools will work for just about any C project and include a number of features tailored for embedded environments. As an added bonus Mark has put his artistic skills to use and created a short graphic novel that explains how to use the tools. Mark’s message follows…

ADDENDUM (Jan. 4 2011): The full suite of open source C tools we support and use includes two more: CException and Ceedling. CException is a library for adding exceptions to single or multi-threaded C projects. As it’s “simple”, it’s also mature and stable. Ceedling is the youngest of all the tools, and is not yet even officially released though it’s fairly capable as is. Ceedling ties together the other three tools with your compiler toolchain via a configuration file to create test & release build environments with a minimum of hassle.


For anyone who is using (or has been thinking of using) Unity and/or CMock for unit testing in C, the latest version of each has been released. Both have been made easier to use and configure, and both have been tested on many different targets and compilers at this point. If you’re interested in the latest releases, grab them from the sourceforge sites.

Unity Alone: http://unity.sourceforge.net

CMock and Unity: http://cmock.sourceforge.net

Also, if you’re interested in a mini-book describing how to use these tools (in a non-traditional comical way) you can get a book (paper or pdf) and support these projects at the same time:

http://www.lulu.com/spotlight/mvandervoord

In case you love details, here are the latest features included in these releases:

Unity

  • Added optional 64-bit support
  • Added optional parameterized test support
  • Added optional verbose floating point support
  • Added pointer asserts and size options
  • Added array asserts for all numerical types
  • Added fallback memory asserts
  • Added more sample targets (like gcc64 and Hi-Tech PICC)
  • RUN_TEST now has default implementation, so users who don’t want to use the scripts can more easily use Unity
  • Significant updates to API and output for consistency
  • Added optional “extras” folder for non-standard uses (like ‘fixture’ which makes Unity act a bit like CppUTest, originally submitted by James Grenning)
  • Optional Ruby Scripts now compatible with Ruby 1.8.6 through 1.9.2

CMock

  • Even Better Parser than 1.9 (someday maybe it’ll be a full-blown C parser)
    • strange arrays containing arithmetic operators, etc.
    • more difficult anonymous function pointers
    • loads of little detailed fixes here and there.
  • Smart internal memory management
    • CMock 2 has a much smarter built-in memory manager for storing all those expected and returnable values. You can even teach it to understand your processor’s alignment and packing needs.
    • It’s fast… WAY faster than CMock 1.
    • It’s efficient… WAY more compact than CMock 1.
  • Pointers and Arrays
  • The Actual Line Number
    • How embarrassing. When CMock was an internal project it was acceptable to report failures as the line in the Mock file… but the test writer cares about the line in the TEST that failed. We’ve fixed that.
  • Better variable naming to avoid conflicts
  • Supports all the latest Unity assertions internally.

Thanks! Happy testing!