exercism/xcpp — pull request #1 by sunzenshen (2014-07-27 09:00:35+00:00)
Title: Hamming exercise submission to exercism/xcpp

This first exercise submission will hopefully spur some discussion regarding how the xCpp track should be implemented. The hamming exercise folder seems a bit heavy as is, so there's no doubt that it could be streamlined. And the choice of unit test framework is likely up for debate.

I chose [CppUTest](http://cpputest.github.io/) as the unit testing framework, partly because it had a large number of stars on GitHub. Support for apt-get and brew didn't hurt either.

This is how I set up my environment on OSX:
* Installed cmake and cpputest with homebrew
```
brew install cmake
brew install cpputest
```
* The CPPUTEST_HOME environment variable needs to be set to the cpputest directory. In my case, it was at:
```
/usr/local/Cellar/cpputest/3.5
```
* To build the unit tests, create a "build" directory in the hamming exercise folder
```
mkdir build
cd build
cmake ..
make all
```
* To actually run the unit tests, run them with
```
./bin/RunAllTests
```
(Where RunAllTests is located in xcpp/hamming/build/bin/)

Sources of research:
* This [tutorial](http://kyokomi.hatenablog.com/entry/2014/04/23/222027) was a reference for getting started. Which is odd, because I don't understand Japanese.
* This [skeleton repository](https://github.com/davisford/cmake-cpputest) was used as a template.
* The [manual](http://cpputest.github.io/manual.html) for CppUTest
* Dr. Dobbs has an [article about "Unit Testing in C"](http://dc.ubm-us.com/i/300036) that featured CppUTest and Unity (for C)