2008/12/27 Mark Kromis <span dir="ltr"><<a href="mailto:greybird@mac.com">greybird@mac.com</a>></span><br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div style=""><div>Just a curiosity question, why push for gtest vs Boost Test or a different test suite?</div><div>I normally use Boost, and their test suite, so I'm more familiar with that. So I was wondering is one better then the other, or is it just that someone makes a patch for it?</div>
</div></blockquote><div><br>I looked more into Boost.Test to see what's in it.  Boost.Test doesn't seem to be stand-alone -- I don't see a way to use Boost.Test without importing some other chunks of Boost that the testing library depends on.  While Boost is a fine set of libraries, I don't think we want to increase the LLVM distribution by sizeof(Boost) just to enable unittesting, nor do we want to spend the time on maintaining a subset of Boost that's "just enough" to build and use the unittest library, along a modified configure/build process that Boost wants to use (Boost.Build? Boost.Jam?).<br>
<br>Boost also seems to want to use exceptions, and LLVM does not want to.  I'm not sure if there would be some difficulties in running a build where some libraries are compiled with no exceptions, some with, and the results are linked together.  At the best case, it would complicate our build system to be able to support different set of flags for building LLVM libraries vs. Boost.Test (and the rest of Boost that we import).<br>
<br>Sample usage of Boost.Test: <a href="http://svn.boost.org/svn/boost/trunk/libs/test/example/unit_test_example_12.cpp">http://svn.boost.org/svn/boost/trunk/libs/test/example/unit_test_example_12.cpp</a><br>Note the code at the end setting up the test suite -- this is boilerplate code that I think shouldn't be necessary to setup and run tests.<br>
<br>Google Test, on the other hand, has no external dependencies, and is distributed as a dozen of .h/.cc files; supports Makefile, SCons, and Xcode; and doesn't use exceptions or RTTI.<br><br>Sample usage of GTest: <a href="http://code.google.com/p/googletest/source/browse/trunk/samples/sample5_unittest.cc">http://code.google.com/p/googletest/source/browse/trunk/samples/sample5_unittest.cc</a><br>
GTest-specific LOC besides the #include statement: 0.<br><br>Note that I'm not counting main() for either Boost or GTest, because both provide a standard main() for use with almost all test files.<br><br>Misha<br></div>
</div>