tests/run-tests.py
branchstable
changeset 1090 e7e4ca624772
parent 1088 e2d5315a6e38
child 1093 660262879b48
equal deleted inserted replaced
1089:f26e9129f65b 1090:e7e4ca624772
   597     # True or False when in a true or false conditional section
   597     # True or False when in a true or false conditional section
   598     skipping = None
   598     skipping = None
   599 
   599 
   600     def hghave(reqs):
   600     def hghave(reqs):
   601         # TODO: do something smarter when all other uses of hghave is gone
   601         # TODO: do something smarter when all other uses of hghave is gone
       
   602         tdir = TESTDIR.replace('\\', '/')
   602         proc = Popen4('%s -c "%s/hghave %s"' %
   603         proc = Popen4('%s -c "%s/hghave %s"' %
   603                       (options.shell, TESTDIR, ' '.join(reqs)), TESTDIR, 0)
   604                       (options.shell, tdir, ' '.join(reqs)), TESTDIR, 0)
   604         proc.communicate()
   605         proc.communicate()
   605         ret = proc.wait()
   606         ret = proc.wait()
   606         if wifexited(ret):
   607         if wifexited(ret):
   607             ret = os.WEXITSTATUS(ret)
   608             ret = os.WEXITSTATUS(ret)
   608         return ret == 0
   609         return ret == 0
   907             return skip("not executable")
   908             return skip("not executable")
   908         runner = shtest
   909         runner = shtest
   909 
   910 
   910     # Make a tmp subdirectory to work in
   911     # Make a tmp subdirectory to work in
   911     testtmp = os.environ["TESTTMP"] = os.environ["HOME"] = \
   912     testtmp = os.environ["TESTTMP"] = os.environ["HOME"] = \
   912         os.path.join(HGTMP, os.path.basename(test)).replace('\\', '/')
   913         os.path.join(HGTMP, os.path.basename(test))
   913 
   914 
   914     replacements = [
   915     replacements = [
   915         (r':%s\b' % options.port, ':$HGPORT'),
   916         (r':%s\b' % options.port, ':$HGPORT'),
   916         (r':%s\b' % (options.port + 1), ':$HGPORT1'),
   917         (r':%s\b' % (options.port + 1), ':$HGPORT1'),
   917         (r':%s\b' % (options.port + 2), ':$HGPORT2'),
   918         (r':%s\b' % (options.port + 2), ':$HGPORT2'),
  1227             # can't remove on solaris
  1228             # can't remove on solaris
  1228             os.environ[k] = ''
  1229             os.environ[k] = ''
  1229             del os.environ[k]
  1230             del os.environ[k]
  1230 
  1231 
  1231     global TESTDIR, HGTMP, INST, BINDIR, PYTHONDIR, COVERAGE_FILE
  1232     global TESTDIR, HGTMP, INST, BINDIR, PYTHONDIR, COVERAGE_FILE
  1232     TESTDIR = os.environ["TESTDIR"] = os.getcwd().replace('\\', '/')
  1233     TESTDIR = os.environ["TESTDIR"] = os.getcwd()
  1233     if options.tmpdir:
  1234     if options.tmpdir:
  1234         options.keep_tmpdir = True
  1235         options.keep_tmpdir = True
  1235         tmpdir = options.tmpdir
  1236         tmpdir = options.tmpdir
  1236         if os.path.exists(tmpdir):
  1237         if os.path.exists(tmpdir):
  1237             # Meaning of tmpdir has changed since 1.3: we used to create
  1238             # Meaning of tmpdir has changed since 1.3: we used to create