comparison tests/run-tests.py @ 34040:85bfd6a0bdbf

run-tests: extract prefix of bisect commands to a variable This does not change any logic. Differential Revision: https://phab.mercurial-scm.org/D577
author Jun Wu <quark@fb.com>
date Wed, 02 Aug 2017 21:01:38 -0700
parents 72b23c9452d6
children 40313c63da87
comparison
equal deleted inserted replaced
34039:72b23c9452d6 34040:85bfd6a0bdbf
2068 self._runner._checkhglib('Tested') 2068 self._runner._checkhglib('Tested')
2069 2069
2070 savetimes(self._runner._outputdir, result) 2070 savetimes(self._runner._outputdir, result)
2071 2071
2072 if failed and self._runner.options.known_good_rev: 2072 if failed and self._runner.options.known_good_rev:
2073 bisectcmd = ['hg', 'bisect']
2073 def nooutput(args): 2074 def nooutput(args):
2074 p = subprocess.Popen(args, stderr=subprocess.STDOUT, 2075 p = subprocess.Popen(args, stderr=subprocess.STDOUT,
2075 stdout=subprocess.PIPE) 2076 stdout=subprocess.PIPE)
2076 p.stdout.read() 2077 p.stdout.read()
2077 p.wait() 2078 p.wait()
2078 for test, msg in result.failures: 2079 for test, msg in result.failures:
2079 nooutput(['hg', 'bisect', '--reset']), 2080 nooutput(bisectcmd + ['--reset']),
2080 nooutput(['hg', 'bisect', '--bad', '.']) 2081 nooutput(bisectcmd + ['--bad', '.'])
2081 nooutput(['hg', 'bisect', '--good', 2082 nooutput(bisectcmd + ['--good',
2082 self._runner.options.known_good_rev]) 2083 self._runner.options.known_good_rev])
2083 # TODO: we probably need to forward more options 2084 # TODO: we probably need to forward more options
2084 # that alter hg's behavior inside the tests. 2085 # that alter hg's behavior inside the tests.
2085 opts = '' 2086 opts = ''
2086 withhg = self._runner.options.with_hg 2087 withhg = self._runner.options.with_hg
2087 if withhg: 2088 if withhg:
2088 opts += ' --with-hg=%s ' % shellquote(withhg) 2089 opts += ' --with-hg=%s ' % shellquote(withhg)
2089 rtc = '%s %s %s %s' % (sys.executable, sys.argv[0], opts, 2090 rtc = '%s %s %s %s' % (sys.executable, sys.argv[0], opts,
2090 test) 2091 test)
2091 sub = subprocess.Popen(['hg', 'bisect', '--command', rtc], 2092 sub = subprocess.Popen(bisectcmd + ['--command', rtc],
2092 stderr=subprocess.STDOUT, 2093 stderr=subprocess.STDOUT,
2093 stdout=subprocess.PIPE) 2094 stdout=subprocess.PIPE)
2094 data = sub.stdout.read() 2095 data = sub.stdout.read()
2095 sub.wait() 2096 sub.wait()
2096 m = re.search( 2097 m = re.search(