This patch adds a unit test framework to LLVM, along with a sample unit test for DenseMap. I don't expect this patch to be accepted as-is, this is mainly a trial balloon and proof of concept.<div><br></div><div>Some notes about the patch:<br>
<div><br></div><div>1) For the testing framework, I went with Google Test, since it's the one I have the most experience with. I fully expect an extended bikeshed discussion to result from this.</div><div><br></div><div>
2) Both the test framework and the tests are optional build targets, they will not be built with the normal "make all". To build and run the unit tests, use "make check-unit".</div><div><br></div><div>
3) I did not actually include the testing framework in the patch; It will need to be checked in separately. There are two approaches to this. One approach is to use the svn:external feature to create a link to the googletest svn repository from the LLVM svn repository. The other approach is to take a snapshot of googletest and check it in to the LLVM repository.</div>
<div><br></div><div>The GoogleTest tar archive is here: <a href="http://code.google.com/p/googletest/downloads/list">http://code.google.com/p/googletest/downloads/list</a>. I've located it within the LLVM source tree in the location "third-party/googletest".</div>
<div><br></div><div>4) I've included makefiles for building the test framework and unit tests. I had to do a bit of makefile hacking to get this to work, suggestions on how to improve this are welcome.</div><div><br></div>
<div><div>-- <br>-- Talin<br>
</div></div></div>