tests/run-tests.py
changeset 1205 531804688bf5
parent 1204 469ccfe7aa92
child 1208 9bd54c35af97
equal deleted inserted replaced
1202:e475cc6eff08 1205:531804688bf5
   749 def run(cmd, wd, options, replacements):
   749 def run(cmd, wd, options, replacements):
   750     """Run command in a sub-process, capturing the output (stdout and stderr).
   750     """Run command in a sub-process, capturing the output (stdout and stderr).
   751     Return a tuple (exitcode, output).  output is None in debug mode."""
   751     Return a tuple (exitcode, output).  output is None in debug mode."""
   752     # TODO: Use subprocess.Popen if we're running on Python 2.4
   752     # TODO: Use subprocess.Popen if we're running on Python 2.4
   753     if options.debug:
   753     if options.debug:
   754         proc = subprocess.Popen(cmd, shell=True, cwd=wd, stdin=subprocess.PIPE)
   754         proc = subprocess.Popen(cmd, shell=True, cwd=wd)
   755         proc.stdin.close()
       
   756         ret = proc.wait()
   755         ret = proc.wait()
   757         return (ret, None)
   756         return (ret, None)
   758 
   757 
   759     proc = Popen4(cmd, wd, options.timeout)
   758     proc = Popen4(cmd, wd, options.timeout)
   760     def cleanup():
   759     def cleanup():
   873 
   872 
   874     # create a fresh hgrc
   873     # create a fresh hgrc
   875     hgrc = open(HGRCPATH, 'w+')
   874     hgrc = open(HGRCPATH, 'w+')
   876     hgrc.write('[ui]\n')
   875     hgrc.write('[ui]\n')
   877     hgrc.write('slash = True\n')
   876     hgrc.write('slash = True\n')
       
   877     hgrc.write('interactive = False\n')
   878     hgrc.write('[defaults]\n')
   878     hgrc.write('[defaults]\n')
   879     hgrc.write('backout = -d "0 0"\n')
   879     hgrc.write('backout = -d "0 0"\n')
   880     hgrc.write('commit = -d "0 0"\n')
   880     hgrc.write('commit = -d "0 0"\n')
   881     hgrc.write('tag = -d "0 0"\n')
   881     hgrc.write('tag = -d "0 0"\n')
   882     if options.inotify:
   882     if options.inotify: