<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Dec 27, 2008, at 10:33 PM, Misha Brukman wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">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><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></div></blockquote><div><br>The current plan is to check in the unittest library into LLVM and build it as part of the test process, so the user doesn't have to do anything separately.<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 class="Ih2E3d"><br><blockquote type="cite"><div class="gmail_quote"><div>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><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></div></div></div></div></blockquote><div><br>Thanks for the pointer. <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 class="Ih2E3d"><blockquote type="cite"><div class="gmail_quote"><div> 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></div></div></blockquote></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></div></blockquote><div><br>You would need to use fixtures if you are testing classes and their interactions, otherwise each of your test functions will re-do everything that's in the fixture's SetUp() method -- why would you want to repeat the same setup code for every test case?</div></div></blockquote><div><br></div><div>They have something similar, non obvious though.</div><div><a href="http://gamesfromwithin.com/?p=29#comment-47">http://gamesfromwithin.com/?p=29#comment-47</a></div><div><br></div><div><br></div><blockquote type="cite"><div class="gmail_quote"><div><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 class="Ih2E3d"><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></div></div></blockquote></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></div></blockquote><div><br>GTest allows testing for exceptions, it just doesn't require them to work properly:<br> <a href="http://code.google.com/p/googletest/wiki/GoogleTestAdvancedGuide#Exception_Assertions">http://code.google.com/p/googletest/wiki/GoogleTestAdvancedGuide#Exception_Assertions</a></div></div></blockquote><div><br></div><div>ah ok. I misunderstood it then. </div><br><blockquote type="cite"><div class="gmail_quote"><div><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 class="Ih2E3d"><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><div>I think it links to a library as well.</div></div></div></blockquote><div><br>Yes, that's true -- just about any unittesting library will have that requirement, that wasn't part of the comparison.  I was pointing out how much C++ a user has to write in their test files for a reasonable test with fixtures.<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>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></blockquote><div><br>Gordon Henriksen pointed out earlier in the thread that Boost.Test will require pulling in 500 headers from Boost just to work, so that's pretty heavy weight.  Also, I was comparing apples-to-apples, not taking the simplest example of GTest and the most complex of Boost -- the two examples I chose were doing the same thing, i.e., tests with fixtures.</div></div></blockquote><div><br></div><div>ok. I havn't used fixtures for unit testing. Most of the classes don't really cross each other that much. </div><div><br></div><blockquote type="cite"><div class="gmail_quote"><div> <br>What does Boost provide that GTest does not, that you think LLVM needs, such that it's worth importing the entire Boost distribution into the LLVM tree?<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>Were the other test kits looked at? Is gtest the best solution for the project.</div></div></blockquote><div><br>There are dozens of C++ unittesting libraries out there, I admit I haven't looked at all of them.  I don't know which ones are still under active development or use, but I (and a few other posters) are familiar with and have used GTest enough to say that it's very well suited for LLVM.<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>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>I already answered this question above (first option: in the tree).  GTest is under the BSD license, which is compatible with LLVM (though I am not a copyright lawyer).<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>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></blockquote> <div><br>As soon as LLVM outgrows what GTest can do, we can easily write wrapper macros to forward from GTest-style macros to the other, more suitable framework; however, I think you're conflating the two concepts of "light-weight" and "trivial" -- GTest is light-weight, but not trivial.</div></div></blockquote><div><br></div><div>I was just concerned that it was too light-weight. Not really dealing with gtest is why I asked the question.</div><div><br></div><blockquote type="cite"><div class="gmail_quote"><div> <br>Misha<br></div></div> _______________________________________________<br>LLVM Developers mailing list<br>LLVMdev@cs.uiuc.edu         <a href="http://llvm.cs.uiuc.edu">http://llvm.cs.uiuc.edu</a><br><a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br></blockquote><br></div><div><br></div><div>Regards,</div><div>Mark Kromis</div><br></body></html>