[PATCH] Disable Mac OS crash reporter in unittests

Pete Cooper peter_cooper at apple.com
Tue Apr 7 13:17:04 PDT 2015


> On Apr 7, 2015, at 12:39 PM, Reid Kleckner <rnk at google.com> wrote:
> 
> On Tue, Apr 7, 2015 at 12:24 PM, Pete Cooper <peter_cooper at apple.com <mailto:peter_cooper at apple.com>> wrote:
> 
> > On Apr 7, 2015, at 11:46 AM, Justin Bogner <mail at justinbogner.com <mailto:mail at justinbogner.com>> wrote:
> >
> > Reid Kleckner <rnk at google.com <mailto:rnk at google.com>> writes:
> >> We already do this in llvm::sys::PrintStackTraceOnErrorSignal. You could
> >> setenv("LLVM_DISABLE_CRASH_REPORT", "1") to get this behavior.
> >>
> >> Either way is probably fine.
> >
> > Sure, but it makes sense to do this unconditionally in the unit tests.
> > Crash reports for unit tests (especially death tests) are never useful.
> How about this as an alternative?  It adds a boolean to force crash reporting to be disabled.
> 
> Note, I do think all the WIN32 stuff in utils/unittest/UnitTestMain/TestMain.cpp should be moved to PrintStackTraceOnErrorSignal or DisableSystemDialogsOnCrash in Signals.inc, but i don’t have a Windows machine to test that change.  If anyone wants to do that in a follow up based on the boolean I’ve added here then that would be great.
> 
> I think on Windows we don't actually want the boolean, we always want to suppress blocking modal dialogs, no questions asked.
Sounds good.  The bool is in a shared header so has to be there on Windows but just unused.  You ok with the patch as is?
> I have a feeling that DisableSystemDialogsOnCrash is a superset of the code in TestMain. I may try deleting the TestMain code and see if things keep functioning.
That would be great.  Thanks for potentially taking a look at that.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150407/948944eb/attachment.html>


More information about the llvm-commits mailing list