[LLVMdev] Unit testing frameworks

sanjiv gupta sanjiv.gupta at microchip.com
Sat Aug 30 10:55:12 PDT 2008


On Fri, 2008-08-29 at 20:44 -0700, Talin wrote:
> In a recent conversation with Chris it was brought up that the LLVM 
> project doesn't have a way to incorporate fine-grained unit tests (in 
> other words, tests that exersize the members of a single C++ class). I 
> was wondering what is the general feeling about adding this to LLVM.
> 
> Let me discuss some of the details:
> 
> First, there is the question of a test framework. One possibility is to 
> create a custom framework based on the support classes already defined 
> within LLVM; This has the benefit of not adding an extra dependency, 
> minimizes potential license incompatibilities, and may perhaps lead to a 
> more integrated testing experience. The downside is that writing a 
> decent framework is a lot of work, and you aren't going to get something 
> as full-featured or mature as some of the various open-source C++ 
> testing frameworks out there.
> 
> The other alternative is to adopt one of those frameworks. Based on my 
> research, I would go with either UnitTest++ or GoogleTest, as these are 
> the most modern and supported test frameworks available. (There are many 
> others, but the two I mentioned were written with the full knowledge of 
> all of the others and with the benefit of hindsight.)
> 
You may want to look at Cppunit as well.
http://cppunit.sourceforge.net/cppunit-wiki

- Sanjiv



More information about the llvm-dev mailing list