<div class="gmail_quote">On Sat, Oct 15, 2011 at 12:34 AM, David Kristola <span dir="ltr"><<a href="mailto:kristol1@illinois.edu">kristol1@illinois.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
I am working on some new static analysis capabilities for a class<br>
project (new for C/C++, derived from an existing Java tool). While<br>
making a contribution to the Clang code base isn't required for the<br>
class, it is a goal.<br>
<br>
Now that I have a copy of LLVM and Clang source code downloaded,<br>
compiled, and the regression test suite running, i am looking at how to<br>
set up my own tests. When the documentation used the term "regression"<br>
for the test suite, it was accurate. The test suite is a nice<br>
integration-level set of tests.<br>
<br>
But what about unit-level tests? Did i miss something in the<br>
documentation or directory tree? Is there a preferred unit test<br>
framework? I don't want to start coding until i have a failing unit<br>
test in place.<br></blockquote><div><br></div><div>There is a top-level directory in the Clang tree "unittests". It has several tests under it, using the Google Test framework. Currently, the static analyzer doesn't get a lot of unit testing, but there are certainly many parts of it where that would make sense (things like abstract graph algorithms, etc.).</div>
<div><br></div><div>That said, there is more emphasis on somewhat mid-level integration testing in Clang. The tools are architected in a way to facilitate remarkably targeted "regression" tests that focus on a specific piece of functionality. Specifically with the analyzer, usually you can craft a minimal test case which should exhibit a very specific static analysis report. These test cases can be extremely minimal and focused in order to ensure reasonable debugging and targeting of any failures.</div>
<div><br></div><div>Unit tests are often reserved for parts of Clang which don't lend themselves to this, due to abstract functional behavior, etc.</div></div>