llvm.org GIT mirror llvm / 08713b3
Disable the crash reporter when running lit tests. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147965 91177308-0d34-0410-b5e6-96231b3b80d8 Argyrios Kyrtzidis 8 years ago
3 changed file(s) with 22 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
2929 #include
3030 #include
3131 #endif
32 #if HAVE_MACH_MACH_H
33 #include
34 #endif
35
3236 using namespace llvm;
3337
3438 static RETSIGTYPE SignalHandler(int Sig); // defined below.
260264 /// SIGSEGV) is delivered to the process, print a stack trace and then exit.
261265 void llvm::sys::PrintStackTraceOnErrorSignal() {
262266 AddSignalHandler(PrintStackTrace, 0);
267
268 #if defined(__APPLE__)
269 // Environment variable to disable any kind of crash dialog.
270 if (getenv("LLVM_DISABLE_CRASH_REPORT")) {
271 mach_port_t self = mach_task_self();
272
273 exception_mask_t mask = EXC_MASK_CRASH;
274
275 kern_return_t ret = task_set_exception_ports(self,
276 mask,
277 NULL,
278 EXCEPTION_STATE_IDENTITY | MACH_EXCEPTION_CODES,
279 NULL);
280 (void)ret;
281 }
282 #endif
263283 }
264284
265285
238238 SetConsoleCtrlHandler(LLVMConsoleCtrlHandler, TRUE);
239239
240240 // Environment variable to disable any kind of crash dialog.
241 if (getenv("LLVM_DISABLE_CRT_DEBUG")) {
241 if (getenv("LLVM_DISABLE_CRASH_REPORT")) {
242242 #ifdef _MSC_VER
243243 _CrtSetReportHook(CRTReportHook);
244244 #endif
1515 'PATH' : os.pathsep.join(litConfig.path +
1616 [os.environ.get('PATH','')]),
1717 'SYSTEMROOT' : os.environ.get('SYSTEMROOT',''),
18 'LLVM_DISABLE_CRASH_REPORT' : '1',
1819 }
1920
2021 if sys.platform == 'win32':
2122 environment.update({
22 'LLVM_DISABLE_CRT_DEBUG' : '1',
2323 'PATHEXT' : os.environ.get('PATHEXT',''),
2424 'PYTHONUNBUFFERED' : '1',
2525 'TEMP' : os.environ.get('TEMP',''),