GalSim-developers/GalSim — Issue #15: Set up unit testing system
Author: joezuntz
Created: 2012-03-06 12:42:16+00:00
State: open

We need a unit testing system in both C++ and python.

PYTHON

While there is a built-in unit testing module "unittesting", the "nose" framework, which is used by numpy among others, makes it almost trivially easy to write and run tests, so I would recommend that we use that. As a nice bonus it can provide coverage statistics showing which functions and methods have been tested and which have not.

C++
There seem to be several sensible options for C++ unit testing (based in responses on StackOverflow and the wikipedia list!):
- boost test
- UnitTest++
- cppunit

None of the three seems to have very nice documentation!

Boost has the advantage that we are already using part of it, so requiring it is not to much more of a stretch. It is also extremely simple to write tests.
UnitTest++ and cppunit seem to be a little more complex to get set up and running with tests, though possibly this is because they are more organized in the long run.

All three can produce the same XML-based output which can be imported into Jenkins, a web app I've asked Dugan at UCL to set up that can monitor the github repo and provide statistics about passing and failing tests in a continuous and graphical way.

Based on this I'd suggest using the boost system, but would welcome input.