Unit tests and ROOT

In a project I’m working on, we’re creating some ROOT dictionaries form .dlls compiled from C++ code. We also have some ROOT macros that float on top of the compiled code. I’d like to build some unit tests for our program, but I’ve run into a lot of difficulties using commercial frameworks (I’ve tried google test and Catch so far). The main issue is getting the unit tests to interact with the ROOT dictionaries properly. It would also be nice to be able to unit test the interpreted ROOT macros as well as the compiled code.

All this is to say, how do people unit test software written in/for ROOT? I’ve done some poking around, but I haven’t been able to find anything that works yet. I’m hoping someone can point me to some software they’ve used for unit testing, even if it’s just a couple home-brew macros. If it exists, examples would be much appreciated as well!

[quote=“nlupugla”]
All this is to say, how do people unit test software written in/for ROOT? I’ve done some poking around, but I haven’t been able to find anything that works yet. I’m hoping someone can point me to some software they’ve used for unit testing, even if it’s just a couple home-brew macros. If it exists, examples would be much appreciated as well![/quote]
For ROOT itself, we use CTest to define tests. These can either be an executable but also the execution of a macro. We have written a small wrapper function on top of the add_test() command in CTest to set a number of convenient parameters for the tests. For example the way to define the ROOT tutorials as tests is like this:

  ROOT_ADD_TEST(tutorial-${tname}
                COMMAND ${ROOT_root_CMD} -b -l -q ${CMAKE_CURRENT_SOURCE_DIR}/${tmacro}
                FAILREGEX "Error in" "error:" "segmentation violation"
                LABELS tutorial
                DEPENDS tutorial-hsimple ...
                ENVIRONMENT ${ROOT_environ})