May 13, 2009
More CppUTest Than I Can Chew

Today’s task was to get CppUTest built on OSX and get familiar with the syntax by writing a couple of simple example programs or doing a code Kata or two.

It turns out there are a bunch of prerequisites to doing any TDD in C++. Most of what I’m missing involves knowing how to:

  • Set up a source tree correctly (or at least in a sane way)
  • Use the GNU compiler with more than just the -o and -I arguments
  • Write a Makefile
  • Link a test program with a test framework/library

I’m trying to do all of this outside of an IDE. No Visual Studio, no Eclipse; just the shell, Vim and the GNU compiler/tools.

Most of the sparse documentation of CppUTest is about its usage inside your test programs, rather than how to configure a build environment that will play nicely with the framework. I found some instructions on how to integrate with Visual Studio, which doesn’t really help me. I need something a bit more basic.

If I can figure this out, I’ll definitely have to write up some instructions, or a guide. This is really a big hurdle to starting TDD in C++ and I’m betting it puts people off. I don’t want to rely on the behind-the-scenes magic of an IDE before I know how the guts work because I’m worried about not understanding the fundamentals of how a build hangs together.