search the lab

Embedded Testing with Unity & CMock (by Mark)

Embedded Testing with Unity & CMock

James Grenning's book (features Unity)

Test Driven Development for Embedded C

Topics

« Using Eclipse IDE | Main | CMock Intro »
Wednesday
Feb162011

Ceedling Intro

What is Ceedling?

Ceedling is a build system for C projects that is something of an extension around Ruby’s Rake (make-ish) build system. Ceedling is primarily targeted at Test-Driven Development in C and is designed to pull together CMock, Unity, and CException -- three other awesome open-source projects you can’t live without if you're creating awesomeness in the C language. In order to spread the awesomeness around, Ceedling is an extensible contraption with a nice plugin mechanism.

Ceedling is our latest piece of awesomeness geared to pull together all of our C developer goodies into something more cohesive. It is packaged up in a Ruby Gem freely available for mass consumption:

Installing Ceedling

First, you will need to install Ruby (version 1.8.6 or newer. We are enjoying 1.9.2 at the moment).

Ceedling was created to pull together a lot of the magic that duct-taped these individual tools together into a cohesive system. Recently, we also created the Ceedling Ruby Gem which you can grab from RubyGems:

http://rubygems.org/gems/ceedling

The gemification of Ceedling makes getting rolling as easy as typing:

gem install ceedling

If you're going through a firewall (as many people are at work), you may need a slightly more complicated version:

gem install ceedling --http-proxy=http://user:password@server:port

Though Ceedling is officially still in its beta state, it is fully functional and documented as well. Feel free to dig in, and also please feel free to give us feedback in how we can help you and improve the docs. We want to crank the awesomeness up to 11, and your input will help make that happen!

You first need to have the Ruby scripting language installed, and have RubyGems support as well to utilize the gem. Additionally, Ceedling also needs to have some form of GNU GCC tools installed for compilation. Other embedded toolchains are supported as well, but GCC is supported out-of-the box and is also used for dependency generation and preprocessing of files (by default).

To see what you can do with the gem, just call the executable with no arguments:

ceedling

Which will show you the available goodness:

Tasks:
  ceedling example PROJ_NAME [DEST]  # create specified example project (in DEST, if specified)
  ceedling examples                  # list available example projects
  ceedling help [TASK]               # Describe available tasks or one specific task
  ceedling new PROJECT_NAME          # create a new ceedling project
  ceedling update DIRECTORY          # update the vendor/ceedling directory under the given project root
  ceedling version                   # print all ceedling gem and library versions

The Ceedling gem also allows you to generate the skeleton for starting a new project:

ceedling new MyNewProject

You can also generate a sample project that is fully tested in order to have something that just works to refer to:

ceedling example temp_sensor

And finally, you can test your ceedling project as follows (via Rake):

rake test:all

Good luck with Ceedling, and feel free to let us know how your adventures in TDDing embedded C go!

Helpful Links