On Sat, Dec 27, 2008 at 6:56 PM, Mark Kromis <span dir="ltr"><<a href="mailto:greybird@mac.com">greybird@mac.com</a>></span> wrote:<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=""><br><div><div class="Ih2E3d"><div>On Dec 27, 2008, at 7:41 PM, Misha Brukman wrote:</div><br><blockquote type="cite">2008/12/27 Mark Kromis <span dir="ltr"><<a href="mailto:greybird@mac.com" target="_blank">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><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?).</div>
</div></blockquote><div><br></div></div><div>So are you planning on maintaining whatever test system, or just have them as a pre-requisite. For example are you going to have the gtest incorporated, or have them install it separately first? I was under the impression that the user would have to install gtest first.</div>
<div class="Ih2E3d"><br><blockquote type="cite"><div class="gmail_quote"><div><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).</div>
</div></blockquote><div><br></div></div><div><a href="http://www.boost.org/doc/libs/1_37_0/libs/utility/throw_exception.html" target="_blank">http://www.boost.org/doc/libs/1_37_0/libs/utility/throw_exception.html</a></div>
<div>#define BOOST_NO_EXCEPTIONS</div><div class="Ih2E3d"><div><br></div><blockquote type="cite"><div class="gmail_quote"><div> <br>Sample usage of Boost.Test: <a href="http://svn.boost.org/svn/boost/trunk/libs/test/example/unit_test_example_12.cpp" target="_blank">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></div></div></blockquote><div><br></div><div><br></div></div><div><a href="http://svn.boost.org/svn/boost/trunk/libs/test/example/unit_test_example_01.cpp" target="_blank">http://svn.boost.org/svn/boost/trunk/libs/test/example/unit_test_example_01.cpp</a></div>
<div>My test cases are not that in-depth, I'm much closer to sample 1. I haven't found a reason to go that crazy yet.</div><div class="Ih2E3d"><div><br></div><br><blockquote type="cite"><div class="gmail_quote"><div>
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></div></div></blockquote><div>
<br></div></div><div>Gtest is much more lightweight, no comparison there. I know that llvm is not very good with exceptions, but should a test case system support that?</div><div class="Ih2E3d"><div><br></div><br><blockquote type="cite">
<div class="gmail_quote"><div>Sample usage of GTest: <a href="http://code.google.com/p/googletest/source/browse/trunk/samples/sample5_unittest.cc" target="_blank">http://code.google.com/p/googletest/source/browse/trunk/samples/sample5_unittest.cc</a><br>
 GTest-specific LOC besides the #include statement: 0.<br></div></div></blockquote><div><br></div></div><div>I think it links to a library as well.</div><br><blockquote type="cite"><div class="Ih2E3d"><div class="gmail_quote">
<div>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></div><div class="Ih2E3d"> _______________________________________________<br>
LLVM Developers mailing list<br><a href="mailto:LLVMdev@cs.uiuc.edu" target="_blank">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br><a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
</div></blockquote></div><br><div>Also for a note of reference, your links to the examples are the most advanced samples. So boost can do more, thus has more weight/bloat behind it.</div><div><br></div><div>Were the other test kits looked at? Is gtest the best solution for the project. </div>
<div><br></div><div>Is this something your planning as putting in the tree, thus require pulling in changes from google (license allowing), or does user need to have the libraries/headers pre-installed?</div></div></blockquote>
<div><br>Including it in the tree is the most reasonable thing to do. No point in inconveniencing the user over tiny libraries with liberal licenses.<br> <br></div><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></div><div><br></div><div><div>My question was not to cause a battle, but I wanted to be sure we were using the right test kit, and not just picking one just because.  For example gtest is very light weight test kit, that can do the job, but will the tests outgrow what the test kit can do, and cause a conversion to a more advanced one later?</div>
</div></div></blockquote><div><br>I am not sure what advanced features you are thinking of that gtest doesn't already offer; it's pretty sophisticated despite it's small size. Can you give an example of something gtest doesn't already support? Newer releases added support for data parameterized tests, which is really useful. Type parameterized tests are being discussed on the mailing list. All while maintaining a small codebase!<br>
</div><div><br>One other nice feature of using gtest is that it integrates with gmock, one of the only really good C++ mocking libraries available. It was just recently released.<br><br><a href="http://code.google.com/p/googlemock">http://code.google.com/p/googlemock</a> <br>
<br>Keir<br><br></div><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><div></div><div><br></div></div><div>Regards,</div>
<div>Mark Kromis</div></div><br>_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
<br></blockquote></div><br>