alcap-org/AlcapDAQ — pull request #77 by litchfld (2014-06-10 17:18:42+00:00)
Title: Feature/unit test

Because coding up large chunks without being able to test them is painful and bug-prone, I added a test harness based on TUT: http://mrzechonek.github.io/tut-framework/

It shouldn't do anything to existing code, but adds a new directory `unit_test` to which, um, unit tests can be added. So far there is only one test, an example, and I haven't yet checked that tests based on our code (as opposed to generic C++) will build. The problem here is the Makefile: Because `main.o` is treated in the same way as any other object file I had to sneak around the back a bit to build the test executable. If anyone enjoys playing with makefiles enough to want to clean that up and make sure it all works, then be my guest. I'd personally rather leave it until I have no other choice.

I also had to fake up instances of all the variables declared 'extern' which may come back to bite you if you try to test anything that relies on them behaving as they do in rootana's main.cpp. But it's better than nothing.

Look at the file `src/unit_test/example_test.cpp` and try building and running the app with:
```bash
bash$ cd rootana
bash$ make tut
bash$ ./unit_test
```
and let me know if what you think.