tests/run-tests.py
changeset 39717 7f8b7a060584
parent 39714 491fc3f4be67
child 39718 ac32685011a3
equal deleted inserted replaced
39716:4dca2e028f0a 39717:7f8b7a060584
  1211     def refpath(self):
  1211     def refpath(self):
  1212         return os.path.join(self._testdir, b'%s.out' % self.bname)
  1212         return os.path.join(self._testdir, b'%s.out' % self.bname)
  1213 
  1213 
  1214     def _run(self, env):
  1214     def _run(self, env):
  1215         py3kswitch = self._py3kwarnings and b' -3' or b''
  1215         py3kswitch = self._py3kwarnings and b' -3' or b''
  1216         cmd = b'%s%s "%s"' % (PYTHON, py3kswitch, self.path)
  1216         cmd = b'"%s"%s "%s"' % (PYTHON, py3kswitch, self.path)
  1217         vlog("# Running", cmd)
  1217         vlog("# Running", cmd)
  1218         normalizenewlines = os.name == 'nt'
  1218         normalizenewlines = os.name == 'nt'
  1219         result = self._runcommand(cmd, env,
  1219         result = self._runcommand(cmd, env,
  1220                                   normalizenewlines=normalizenewlines)
  1220                                   normalizenewlines=normalizenewlines)
  1221         if self._aborted:
  1221         if self._aborted:
  1473                 pos = n
  1473                 pos = n
  1474                 if not inpython:
  1474                 if not inpython:
  1475                     # We've just entered a Python block. Add the header.
  1475                     # We've just entered a Python block. Add the header.
  1476                     inpython = True
  1476                     inpython = True
  1477                     addsalt(prepos, False) # Make sure we report the exit code.
  1477                     addsalt(prepos, False) # Make sure we report the exit code.
  1478                     script.append(b'%s -m heredoctest <<EOF\n' % PYTHON)
  1478                     script.append(b'"%s" -m heredoctest <<EOF\n' % PYTHON)
  1479                 addsalt(n, True)
  1479                 addsalt(n, True)
  1480                 script.append(l[2:])
  1480                 script.append(l[2:])
  1481             elif l.startswith(b'  ... '): # python inlines
  1481             elif l.startswith(b'  ... '): # python inlines
  1482                 after.setdefault(prepos, []).append(l)
  1482                 after.setdefault(prepos, []).append(l)
  1483                 script.append(l[2:])
  1483                 script.append(l[2:])
  3076         """Return the path to the mercurial package that is actually found by
  3076         """Return the path to the mercurial package that is actually found by
  3077         the current Python interpreter."""
  3077         the current Python interpreter."""
  3078         if self._hgpath is not None:
  3078         if self._hgpath is not None:
  3079             return self._hgpath
  3079             return self._hgpath
  3080 
  3080 
  3081         cmd = b'%s -c "import mercurial; print (mercurial.__path__[0])"'
  3081         cmd = b'"%s" -c "import mercurial; print (mercurial.__path__[0])"'
  3082         cmd = cmd % PYTHON
  3082         cmd = cmd % PYTHON
  3083         if PYTHON3:
  3083         if PYTHON3:
  3084             cmd = _strpath(cmd)
  3084             cmd = _strpath(cmd)
  3085         pipe = os.popen(cmd)
  3085         pipe = os.popen(cmd)
  3086         try:
  3086         try: