def write_report(name, suitefile, rangelist, arglist, statsTotalCase, statsFail, statsPass, report, suiteStartTime, suiteEndTime): htmlstring = array2html(suitefile, rangelist, ','.join(arglist), statsTotalCase, statsFail + statsPass, statsPass, statsFail, statsTotalCase - statsFail - statsPass, report, suiteStartTime, suiteEndTime) reportfilename = '../../log/%s.html' % (name) with open(reportfilename, 'wb') as f: f.write(htmlstring.encode(encoding='utf_8', errors='strict'))
def write_report(name, suitefile,rangelist, arglist, statsTotalCase,statsFail,statsPass,report, suiteStartTime, suiteEndTime): htmlstring = array2html(suitefile,rangelist,','.join(arglist), statsTotalCase,statsFail+statsPass,statsPass,statsFail, statsTotalCase-statsFail-statsPass,report, suiteStartTime, suiteEndTime) reportfilename = '../../log/%s.html'%(name) with open(reportfilename, 'wb') as f: f.write(htmlstring.encode(encoding='utf_8', errors='strict'))
break casename = '%d' % index logdir = '../../log/' + suitefile + '/' + casename suiteEndTime = time.time() write_report(name, suitefile, rangelist, arglist, statsTotalCase, statsFail, statsPass, report, suiteStartTime, suiteEndTime) #htmlstring = array2html(suitefile,rangelist,','.join(arglist), statsTotalCase,statsFail+statsPass,statsPass,statsFail, statsTotalCase-statsFail-statsPass,report, suiteStartTime, suiteEndTime, finish=True) #reportfilename = '../../log/%s.html'%(name) #with open(reportfilename, 'wb') as f: # f.write(htmlstring.encode(encoding='utf_8', errors='strict')) except KeyboardInterrupt: try: print('Pass:'******'Fail', statsFail) suiteEndTime = time.time() htmlstring = array2html(suitefile, rangelist, ','.join(arglist), statsTotalCase, statsFail + statsPass, statsPass, statsFail, statsTotalCase - statsFail - statsPass, report, suiteStartTime, suiteEndTime) reportfilename = '../../log/%s.html' % (name) except: pass #if dut_pool.__len__()!={}: releaseDUTs(dut_pool, suite_logger) print('#' * 80) print('Pass:'******'Fail', statsFail) os._exit(0)
if breakFlag: break casename='%d'%index logdir ='../../log/'+suitefile+'/'+casename suiteEndTime = time.time() write_report(name, suitefile,rangelist, arglist, statsTotalCase,statsFail,statsPass,report, suiteStartTime, suiteEndTime) #htmlstring = array2html(suitefile,rangelist,','.join(arglist), statsTotalCase,statsFail+statsPass,statsPass,statsFail, statsTotalCase-statsFail-statsPass,report, suiteStartTime, suiteEndTime, finish=True) #reportfilename = '../../log/%s.html'%(name) #with open(reportfilename, 'wb') as f: # f.write(htmlstring.encode(encoding='utf_8', errors='strict')) except KeyboardInterrupt: try: print('Pass:'******'Fail', statsFail) suiteEndTime = time.time() htmlstring = array2html(suitefile,rangelist,','.join(arglist), statsTotalCase,statsFail+statsPass,statsPass,statsFail, statsTotalCase-statsFail-statsPass,report, suiteStartTime, suiteEndTime) reportfilename = '../../log/%s.html'%(name) except: pass #if dut_pool.__len__()!={}: releaseDUTs(dut_pool, suite_logger) print('#'*80) print('Pass:'******'Fail', statsFail) os._exit(0)