コード例 #1
0
def main(argv):
    '''args = arguments()
    isArgRight, argDict = args.detectArg(argv[1:])
    if False == isArgRight:
        return False'''

    config = sysconf.SysConfig("config.txt")
    for deviceConf in config.deviceconf:
        testTime = timer()
        testTime.timeStart()
        print("{0} test start...".format(deviceConf.device))
        plan = tc.TestPlan(deviceConf)

        if True == plan.loadCase():
            report = rp.TestReport()

            doPlan(plan, report)
            testTime.timeEnd()
            testTime.spendTime()
            print("\nStart time: {0}".format(testTime.start))
            print("End time: {0}".format(testTime.end))
            print("Duration: {0}\n\n".format(testTime.duration))

            report.preProcess()
            report.ReportFileTxt(deviceConf.device, testTime)
            report.ReportFileHtml(deviceConf.device, testTime)
            report.dumpJson(deviceConf.device)
            reportTmp = rp.TestReport()
            reportTmp.mergeJson(["output/DEVICE1/TestReport.json"])
            reportTmp.ReportFileTxt("MERGE", None)
            reportTmp.ReportFileHtml("MERGE", None)
            reportTmp.dumpJson("MERGE")
        else:
            print("{0} load test case file fail!".format(deviceConf.device))
            return False
    return True