Beispiel #1
0
def run_perf_tests(tests, debug=testDebug, mask=testMask, logName=logFileName):
    """Method to execute cats tests, must be in Performance directory"""

    logger = TestOutput(stdout=True, debug=0, logName=logName)
    logger.startSuite(name='ChandlerTestSuite')
    for paramSet in tests.split(','):
        try:
            filenameAndTest = paramSet.split(':')

            #assume file name and and test name are the same if only one given
            if len(filenameAndTest) < 2:
                filenameAndTest.append(filenameAndTest[0])

            teststring = 'from tools.cats.Performance.%s import %s' % (
                filenameAndTest[0], filenameAndTest[1])
            exec(compile(teststring, '', 'exec'))
            teststring = 'test = %s(name=\'%s\', logger=logger)' % (
                filenameAndTest[1], filenameAndTest[1])
            exec(compile(teststring, '', 'exec'))
            test.runTest()
            if logger.debug == 2: checkRepo(logger)
        except:
            logger.traceback()

    logger.endSuite()
    if logger.debug == 0:
        logger.easyReadSummary()
    else:
        logger.summary()
    logger.simpleSummary()
    logger.tinderOutput()
    if logger.debug < 2: checkRepo(logger)
    logger.endSuite()
    import osaf.framework.scripting as scripting
    scripting.app_ns().root.Quit()
Beispiel #2
0
def run_perf_tests(tests, debug=testDebug, mask=testMask, logName=logFileName):
    """Method to execute cats tests, must be in Performance directory"""

    logger = TestOutput(stdout=True, debug=0, logName=logName)
    logger.startSuite(name='ChandlerTestSuite')
    for paramSet in tests.split(','):
        try:
            filenameAndTest = paramSet.split(':')
            
            #assume file name and and test name are the same if only one given
            if len(filenameAndTest) < 2: filenameAndTest.append(filenameAndTest[0])
            
            teststring = 'from tools.cats.Performance.%s import %s' % (filenameAndTest[0], filenameAndTest[1])
            exec(compile(teststring, '', 'exec'))
            teststring = 'test = %s(name=\'%s\', logger=logger)' % (filenameAndTest[1], filenameAndTest[1])
            exec(compile(teststring, '', 'exec'))
            test.runTest()
            if logger.debug == 2: checkRepo(logger)
        except:
            logger.traceback()
            
    logger.endSuite()
    if logger.debug == 0:
        logger.easyReadSummary()
    else:
        logger.summary()
    logger.simpleSummary()
    logger.tinderOutput()
    if logger.debug < 2: checkRepo(logger)
    logger.endSuite()
    import osaf.framework.scripting as scripting
    scripting.app_ns().root.Quit()
Beispiel #3
0
def run_tests(tests, debug=testDebug, mask=testMask, logName=logFileName):
    """Method to execute cats tests, must be in Functional directory."""

    logger = TestOutput(stdout=True, debug=debug, mask=mask, logName=logName)
    testList = tests.split(',')
    statusBar = Block.findBlockByName("StatusBar")
    totalTests = len(tests.split(','))
    curTest = 0

    if len(testList) < 2:
        logger.startSuite(name=testList[0].split(':')[0])
    else:
        logger.startSuite(name='ChandlerFunctionalTestSuite')

    # We'll normally run individual tests with an exception wrapper;
    # --catch=never will turn it off, so that a debugger can stop on
    # uncaught exceptions.
    runner = Globals.options.catch != 'never' and run_test_wrapped or run_test
    for paramSet in testList:
        curTest += 1
        statusBar.setStatusMessage(
            "Test %d of %d %s" % (curTest, totalTests, paramSet.split(":")[0]))
        runner(logger, paramSet)
        if haltOnFailure and logger.testHasFailed:
            logger.report(False, 'Suite halted on test failure')
            logger.testsSkipped = len(
                tests.split(',')) - (tests.split(',').index(paramSet) + 1)
            break

    if logger.debug < 2: checkRepo(logger)
    logger.endSuite()
    if logger.debug == 0:
        logger.easyReadSummary()
    else:
        logger.summary()
    logger.simpleSummary()
    logger.tinderOutput()
    scripting.app_ns().root.Quit()
Beispiel #4
0
def run_tests(tests, debug=testDebug, mask=testMask, logName=logFileName):
    """Method to execute cats tests, must be in Functional directory."""
    
    logger = TestOutput(stdout=True, debug=debug, mask=mask, logName=logName) 
    testList = tests.split(',')
    statusBar = Block.findBlockByName("StatusBar")
    totalTests = len(tests.split(','))
    curTest = 0
    
    if len(testList) < 2:
        logger.startSuite(name = testList[0].split(':')[0])
    else:
        logger.startSuite(name='ChandlerFunctionalTestSuite')
    
    # We'll normally run individual tests with an exception wrapper; 
    # --catch=never will turn it off, so that a debugger can stop on 
    # uncaught exceptions.
    runner = Globals.options.catch != 'never' and run_test_wrapped or run_test
    for paramSet in testList:       
        curTest += 1
        statusBar.setStatusMessage("Test %d of %d %s" % (curTest, totalTests, paramSet.split(":")[0]))
        runner(logger, paramSet)
        if haltOnFailure and logger.testHasFailed:
            logger.report(False, 'Suite halted on test failure')
            logger.testsSkipped = len(tests.split(',')) - (tests.split(',').index(paramSet) + 1)
            break

    if logger.debug < 2: checkRepo(logger)
    logger.endSuite()
    if logger.debug == 0:
        logger.easyReadSummary()
    else:
        logger.summary()
    logger.simpleSummary()
    logger.tinderOutput()
    scripting.app_ns().root.Quit()