tests/run-tests.py
branchstable
changeset 944 37aff8ccb33e
parent 943 1f7fd6db1e17
child 945 83e828101e3c
equal deleted inserted replaced
943:1f7fd6db1e17 944:37aff8ccb33e
    71 
    71 
    72     p.fromchild = p.stdout
    72     p.fromchild = p.stdout
    73     p.tochild = p.stdin
    73     p.tochild = p.stdin
    74     p.childerr = p.stderr
    74     p.childerr = p.stderr
    75 
    75 
       
    76     p.timeout = False
    76     if timeout:
    77     if timeout:
    77         p.timeout = False
       
    78         def t():
    78         def t():
    79             start = time.time()
    79             start = time.time()
    80             while time.time() - start < timeout and p.returncode is None:
    80             while time.time() - start < timeout and p.returncode is None:
    81                 time.sleep(1)
    81                 time.sleep(1)
    82             p.timeout = True
    82             p.timeout = True
   240     if options.debug:
   240     if options.debug:
   241         if options.timeout != defaults['timeout']:
   241         if options.timeout != defaults['timeout']:
   242             sys.stderr.write(
   242             sys.stderr.write(
   243                 'warning: --timeout option ignored with --debug\n')
   243                 'warning: --timeout option ignored with --debug\n')
   244         options.timeout = 0
   244         options.timeout = 0
       
   245     if options.timeout and not hasattr(subprocess.Popen, 'terminate'):
       
   246         sys.stderr.write('warning: timeout is not supported on this '
       
   247                          'platform and will be ignored')
       
   248         options.timeout = 0
   245     if options.py3k_warnings:
   249     if options.py3k_warnings:
   246         if sys.version_info[:2] < (2, 6) or sys.version_info[:2] >= (3, 0):
   250         if sys.version_info[:2] < (2, 6) or sys.version_info[:2] >= (3, 0):
   247             parser.error('--py3k-warnings can only be used on Python 2.6+')
   251             parser.error('--py3k-warnings can only be used on Python 2.6+')
   248     if options.blacklist:
   252     if options.blacklist:
   249         blacklist = dict()
   253         blacklist = dict()