##// END OF EJS Templates
run-tests: extract Popen logic to a single method...
Jun Wu -
r34804:d817bf1f default
parent child Browse files
Show More
@@ -2103,16 +2103,16 b' class TextTestRunner(unittest.TextTestRu'
2103 2103 bisectrepo = self._runner.options.bisect_repo
2104 2104 if bisectrepo:
2105 2105 bisectcmd.extend(['-R', os.path.abspath(bisectrepo)])
2106 def nooutput(args):
2106 def pread(args):
2107 2107 p = subprocess.Popen(args, stderr=subprocess.STDOUT,
2108 2108 stdout=subprocess.PIPE)
2109 p.stdout.read()
2109 data = p.stdout.read()
2110 2110 p.wait()
2111 return data
2111 2112 for test in tests:
2112 nooutput(bisectcmd + ['--reset']),
2113 nooutput(bisectcmd + ['--bad', '.'])
2114 nooutput(bisectcmd + ['--good',
2115 self._runner.options.known_good_rev])
2113 pread(bisectcmd + ['--reset']),
2114 pread(bisectcmd + ['--bad', '.'])
2115 pread(bisectcmd + ['--good', self._runner.options.known_good_rev])
2116 2116 # TODO: we probably need to forward more options
2117 2117 # that alter hg's behavior inside the tests.
2118 2118 opts = ''
@@ -2121,11 +2121,7 b' class TextTestRunner(unittest.TextTestRu'
2121 2121 opts += ' --with-hg=%s ' % shellquote(_strpath(withhg))
2122 2122 rtc = '%s %s %s %s' % (sys.executable, sys.argv[0], opts,
2123 2123 test)
2124 sub = subprocess.Popen(bisectcmd + ['--command', rtc],
2125 stderr=subprocess.STDOUT,
2126 stdout=subprocess.PIPE)
2127 data = sub.stdout.read()
2128 sub.wait()
2124 data = pread(bisectcmd + ['--command', rtc])
2129 2125 m = re.search(
2130 2126 (br'\nThe first (?P<goodbad>bad|good) revision '
2131 2127 br'is:\nchangeset: +\d+:(?P<node>[a-f0-9]+)\n.*\n'
General Comments 0
You need to be logged in to leave comments. Login now