[LLVMdev] Any objections to my importing GoogleMock to go with GoogleTest in LLVM?

Pete Cooper peter_cooper at apple.com
Thu Nov 14 16:13:21 PST 2013


On Nov 14, 2013, at 3:28 PM, Chandler Carruth <chandlerc at google.com> wrote:

> 
> On Thu, Nov 14, 2013 at 3:00 PM, Pete Cooper <peter_cooper at apple.com> wrote:
> This is probably most like #1, but i would either improve (or add a verbose option to) -debug-pass=Structure.  Then just write a test which calls opt with some passes and uses FileCheck to verify the debug output.
> 
> Yes, but see the problems with it that I brought up. Note that the new pass manager makes this significantly more complex because there isn't a linear series of passes (regardless of nesting).
CHECK-DAG? :)
> 
> 
> This is nice as it means that if anyone ever wants to verify for performance reasons that a given test invalidates a very specific set of passes and never regresses from that set then they can use FileCheck for this.
> 
> I don't think these are realistic or good tests in the new model... I'm not really sure what we're gaining from this at all. It sounds like a much worse case of what other people are complaining about with unit tests?
I disagree.  To add to those against unit tests, most of us work with FileCheck failures every day.  We're used to debugging them quickly by reading and comparing the IR/assembly against the CHECK lines.

Having your code emit text to debug itself is far easier for all of us than having to open a gmock test in a debugger then try to understand how to even debug the new pass manager.  Arguably as much of our LLVM code as possible should be able to dump strings we can usefully check in FileCheck, but we aren't doing that right now.
>  
> 
> And it looks like debug-pass is available on release builds.
> 
> ... not always. Certainly, with the added complexity needed to check a system that uses active caching, I don't think we would want it in release builds. 
Fair enough.  You know your plans on this code better than I do, and whats appropriate on debug/release.

But i don't see this as a problem.  Most build bots run on multiple different configurations.  Having your tests only on debug or assert builds isn't a huge issue given the amount of testing of those configurations.
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20131114/9631a8dd/attachment.html>


More information about the llvm-dev mailing list