rImportantStdOutLines = rImportantStdOutLines, rImportantStdErrLines = rImportantStdErrLines, bGetDetailsHTML = dxConfig["bSaveReport"], fApplicationRunningCallback = fApplicationRunningHandler, fExceptionDetectedCallback = fExceptionDetectedHandler, fApplicationExitCallback = fApplicationExitHandler, ); oBugId.fWait(); if oBugId.oBugReport: print "* A bug was detected in the application."; print; print " Id: %s" % oBugId.oBugReport.sId; print " Description: %s" % oBugId.oBugReport.sBugDescription; print " Location: %s" % oBugId.oBugReport.sBugLocation; if oBugId.oBugReport.sBugSourceLocation: print " Source: %s" % oBugId.oBugReport.sBugSourceLocation; print " Security impact: %s" % oBugId.oBugReport.sSecurityImpact; if dxConfig["bSaveReport"]: sReportFileName = "%s @ %s.html" % (oBugId.oBugReport.sId, oBugId.oBugReport.sBugLocation); eWriteDataToFileResult = FileSystem.feWriteDataToFile( oBugId.oBugReport.sDetailsHTML, FileSystem.fsLocalPath(FileSystem.fsTranslateToValidName(sReportFileName)), fbRetryOnFailure = lambda: False, ); if eWriteDataToFileResult: print " Bug report: Cannot be saved (%s)" % repr(eWriteDataToFileResult); else: print " Bug report: %s (%d bytes)" % (sReportFileName, len(oBugId.oBugReport.sDetailsHTML)); else: print "* The application has terminated without crashing.";
print; print " Id: %s" % oBugId.oBugReport.sId; print " Description: %s" % oBugId.oBugReport.sBugDescription; print " Location: %s" % oBugId.oBugReport.sBugLocation; if oBugId.oBugReport.sBugSourceLocation: print " Source: %s" % oBugId.oBugReport.sBugSourceLocation; print " Security impact: %s" % oBugId.oBugReport.sSecurityImpact; print " Run time: %s seconds" % (long(oBugId.fnApplicationRunTime() * 1000) / 1000.0); if dxConfig["bSaveReport"]: # We'd like a report file name base on the BugId, but the later may contain characters that are not valid in a file name sDesiredReportFileName = "%s @ %s.html" % (oBugId.oBugReport.sId, oBugId.oBugReport.sBugLocation); # Thus, we need to translate these characters to create a valid filename that looks very similar to the BugId sValidReportFileName = FileSystem.fsTranslateToValidName(sDesiredReportFileName, bUnicode = dxConfig["bUseUnicodeReportFileNames"]); eWriteDataToFileResult = FileSystem.feWriteDataToFile( oBugId.oBugReport.sDetailsHTML, FileSystem.fsLocalPath(sValidReportFileName), fbRetryOnFailure = lambda: False, ); if eWriteDataToFileResult: print " Bug report: Cannot be saved (%s)" % repr(eWriteDataToFileResult); else: print " Bug report: %s (%d bytes)" % (sValidReportFileName, len(oBugId.oBugReport.sDetailsHTML)); else: print "- The application has terminated without crashing."; print " Run time: %s seconds" % (long(oBugId.fnApplicationRunTime() * 1000) / 1000.0); if dxConfig["bShowLincenseAndDonationInfo"]: print; print "This version of BugId is provided free of charge for non-commercial use only."; print "If you find it useful and would like to make a donation, you can send bitcoin"; print "to 183yyxa9s1s1f7JBpPHPmzQ346y91Rx5DX. Please contact the author if you wish to";
from cBugId import cBugId; from cBugId.sOSISA import sOSISA; from cBugId.cBugReport_foAnalyzeException_STATUS_ACCESS_VIOLATION import ddtsDetails_uAddress_sISA; import FileSystem; asTestISAs = [sOSISA]; if sOSISA == "x64": asTestISAs.append("x86"); sBaseFolderPath = os.path.dirname(__file__); dsBinaries_by_sISA = { "x86": os.path.join(sBaseFolderPath, r"Tests\bin\Tests_x86.exe"), "x64": os.path.join(sBaseFolderPath, r"Tests\bin\Tests_x64.exe"), }; sReportsFolderName = FileSystem.fsLocalPath("Sample reports"); bFailed = False; oOutputLock = threading.Lock(); # If you see weird exceptions, try lowering the number of parallel tests: oConcurrentTestsSemaphore = threading.Semaphore(uSequentialTests); class cTest(object): def __init__(oTest, sISA, asCommandLineArguments, sExpectedBugTypeId): oTest.sISA = sISA; oTest.asCommandLineArguments = asCommandLineArguments; oTest.sExpectedBugTypeId = sExpectedBugTypeId; oTest.bInternalException = False; oTest.bHasOutputLock = False; def __str__(oTest): return "%s =%s=> %s" % (" ".join(oTest.asCommandLineArguments), oTest.sISA, oTest.sExpectedBugTypeId);