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)
help='set to run only tests that test program execution to make sure things run on the current OS') parser.add_option('--test',action='store',dest='testname',default=None, help='manually specify a test') (options, args) = parser.parse_args() numprocesses = options.numprocesses if options.numprocesses is not None else cpu_count() if usemultiprocess: print 'using multiprocess' multiprocess._instantiate_plugins = [capture.Capture, xunitmultiprocess.Xunitmp,failuredetail.FailureDetail,callableclass.CallableClass] handler = logging.StreamHandler(sys.stderr) handler.setFormatter(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'] # from IPython import embed; embed() prog=nose.core.TestProgram(argv=argv,plugins=plugins,exit=False)