Example #1
0
            logging.Formatter(
                '%(name)s %(asctime)s: %(levelname)s %(message)s'))
        multiprocess.log.addHandler(handler)
        multiprocess.log.setLevel(logging.DEBUG)
    else:
        print('multiprocess disabled')
    argv = ['nosetests', '-v', '-d', '--with-callableclass', '-s']
    if options.os_only:
        argv.append('test_programs.py')
    if options.testname is not None:
        argv.append(options.testname)
    if options.with_coverage:
        argv += [
            '--with-coverage', '--cover-package=openravepy', '--cover-html'
        ]

    plugins = [
        capture.Capture(),
        failuredetail.FailureDetail(),
        callableclass.CallableClass()
    ]
    if usemultiprocess:
        plugins += [multiprocess.MultiProcess(), xunitmultiprocess.Xunitmp()]
        argv += [
            '--with-xunitmp', '--xunit-file=results.xml',
            '--processes=%d' % numprocesses,
            '--process-timeout=%f' % options.timeout, '--process-restartworker'
        ]

    prog = nose.core.TestProgram(argv=argv, plugins=plugins, exit=False)
Example #2
0
    multiprocess._instantiate_plugins = [
        capture.Capture, xunitmultiprocess.Xunitmp, callableclass.CallableClass
    ]

    header = 'name=\"%s robots\" package=\"%s\"' % (options.robots,
                                                    ikfast.__name__)
    argv = [
        'nosetests', '-v', '--with-xunitmp', '--xunit-file=test_ikfast.xml',
        '--xunit-header=%s' % header,
        '--processes=%d' % options.numprocesses,
        '--process-timeout=%f' % options.timeout, '--process-restartworker',
        '--with-callableclass', 'test_ikfast.py'
    ]
    plugins = [
        capture.Capture(),
        multiprocess.MultiProcess(),
        xunitmultiprocess.Xunitmp(),
        callableclass.CallableClass()
    ]
    prog = nose.core.TestProgram(argv=argv, plugins=plugins, exit=False)
    log.info('processing the global stats')
    stats = []
    while len(test_ikfast.globalstats) > 0:
        stat = test_ikfast.globalstats.pop(0)
        if not stat[5] is None:
            stat.append(open(stat[5], 'r').read())
        else:
            stat.append(None)
        stats.append(stat)
    pickle.dump([stats, options], open('ikfaststats.pp', 'w'))
Example #3
0
    import test_ikfast
    options = parseoptions()
    test_ikfast.options = options

    format = logging.Formatter('%(name)s: %(levelname)s %(message)s')
    handler = logging.StreamHandler(sys.stderr)
    handler.setFormatter(format)
    multiprocess.log.addHandler(handler)
    multiprocess.log.setLevel(options.debug)
    #ikfast.log.addHandler(handler)
    #ikfast.log.setLevel(options.debug)
    
    multiprocess._instantiate_plugins = [capture.Capture, xunitmultiprocess.Xunitmp, callableclass.CallableClass]

    header = 'name=\"%s robots\" package=\"%s\"'%(options.robots,ikfast.__name__)
    argv=['nosetests','-v','--with-xunitmp','--xunit-file=test_ikfast.xml','--xunit-header=%s'%header,'--processes=%d'%options.numprocesses,'--process-timeout=%f'%options.timeout,'--process-restartworker','--with-callableclass','test_ikfast.py']
    plugins=[capture.Capture(),multiprocess.MultiProcess(),xunitmultiprocess.Xunitmp(),callableclass.CallableClass()]
    prog=nose.core.TestProgram(argv=argv,plugins=plugins,exit=False)
    log.info('processing the global stats')
    stats = []
    while len(test_ikfast.globalstats) > 0:
        stat = test_ikfast.globalstats.pop(0)
        if not stat[5] is None:
            with open(stat[5],'r') as f: 
                stat.append(f.read())
        else:
            stat.append(None)
        stats.append(stat)
    with open('ikfaststats.pp','wb') as f:
        pickle.dump([stats,options], f)