[PATCH] Disable Mac OS crash reporter in unittests
Pete Cooper
peter_cooper at apple.com
Tue Apr 7 12:24:17 PDT 2015
> On Apr 7, 2015, at 11:46 AM, Justin Bogner <mail at justinbogner.com> wrote:
>
> Reid Kleckner <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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gtest.diff
Type: application/octet-stream
Size: 2694 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150407/7307b02b/attachment.obj>
-------------- next part --------------
>
> Pete, this LGTM, but please clang-format it before committing. The
> arguments to task_set_exception_ports are indented oddly.
This patch also avoids the duplication so no clang-format issues, but thanks for pointing that out. The original code is formatted that way too, although looks like its because of long enum names.
Cheers,
Pete
>
>> On Tue, Apr 7, 2015 at 11:21 AM, Pete Cooper <peter_cooper at apple.com> wrote:
>>> Hi Justin
>>>
>>> Please review this patch which disables the crash reporter in the unit
>>> tests. This makes tests using EXPECT_DEATH stop taking an unreasonably
>>> long time to run. For example:
>>>
>>> [----------] 47 tests from APFloatTest (51250 ms total)
>>>
>>> to
>>>
>>> [----------] 47 tests from APFloatTest (765 ms total)
>>>
>>> Cheers,
>>> Pete
More information about the llvm-commits
mailing list