tests/run-tests.py
changeset 937 d2ee1f7d81f8
parent 936 7a8ae4eb18bf
child 942 92325072c4d4
equal deleted inserted replaced
933:eb234d5d695c 937:d2ee1f7d81f8
   178 
   178 
   179     # jython is always pure
   179     # jython is always pure
   180     if 'java' in sys.platform or '__pypy__' in sys.modules:
   180     if 'java' in sys.platform or '__pypy__' in sys.modules:
   181         options.pure = True
   181         options.pure = True
   182 
   182 
   183     if not (os.path.isfile(options.shell) and
       
   184             os.access(options.shell, os.X_OK)):
       
   185         parser.error('--shell must be executable')
       
   186 
       
   187     if options.with_hg:
   183     if options.with_hg:
   188         if not (os.path.isfile(options.with_hg) and
   184         if not (os.path.isfile(options.with_hg) and
   189                 os.access(options.with_hg, os.X_OK)):
   185                 os.access(options.with_hg, os.X_OK)):
   190             parser.error('--with-hg must specify an executable hg script')
   186             parser.error('--with-hg must specify an executable hg script')
   191         if not os.path.basename(options.with_hg) == 'hg':
   187         if not os.path.basename(options.with_hg) == 'hg':
   715         result('p', test)
   711         result('p', test)
   716 
   712 
   717     def ignore(msg):
   713     def ignore(msg):
   718         result('i', (test, msg))
   714         result('i', (test, msg))
   719 
   715 
   720     if (test.startswith("test-") and '~' not in test and
   716     if (os.path.basename(test).startswith("test-") and '~' not in test and
   721         ('.' not in test or test.endswith('.py') or
   717         ('.' not in test or test.endswith('.py') or
   722          test.endswith('.bat') or test.endswith('.t'))):
   718          test.endswith('.bat') or test.endswith('.t'))):
   723         if not os.path.exists(test):
   719         if not os.path.exists(test):
   724             skip("doesn't exist")
   720             skip("doesn't exist")
   725             return None
   721             return None
   794             return skip("not executable")
   790             return skip("not executable")
   795         runner = shtest
   791         runner = shtest
   796 
   792 
   797     # Make a tmp subdirectory to work in
   793     # Make a tmp subdirectory to work in
   798     testtmp = os.environ["TESTTMP"] = os.environ["HOME"] = \
   794     testtmp = os.environ["TESTTMP"] = os.environ["HOME"] = \
   799         os.path.join(HGTMP, test)
   795         os.path.join(HGTMP, os.path.basename(test))
   800 
   796 
   801     os.mkdir(testtmp)
   797     os.mkdir(testtmp)
   802     ret, out = runner(testpath, testtmp, options, [
   798     ret, out = runner(testpath, testtmp, options, [
   803         (re.escape(testtmp), '$TESTTMP'),
   799         (re.escape(testtmp), '$TESTTMP'),
   804         (r':%s\b' % options.port, ':$HGPORT'),
   800         (r':%s\b' % options.port, ':$HGPORT'),
   900 def _checkhglib(verb):
   896 def _checkhglib(verb):
   901     """Ensure that the 'mercurial' package imported by python is
   897     """Ensure that the 'mercurial' package imported by python is
   902     the one we expect it to be.  If not, print a warning to stderr."""
   898     the one we expect it to be.  If not, print a warning to stderr."""
   903     expecthg = os.path.join(PYTHONDIR, 'mercurial')
   899     expecthg = os.path.join(PYTHONDIR, 'mercurial')
   904     actualhg = _gethgpath()
   900     actualhg = _gethgpath()
   905     if actualhg != expecthg:
   901     if os.path.abspath(actualhg) != os.path.abspath(expecthg):
   906         sys.stderr.write('warning: %s with unexpected mercurial lib: %s\n'
   902         sys.stderr.write('warning: %s with unexpected mercurial lib: %s\n'
   907                          '         (expected %s)\n'
   903                          '         (expected %s)\n'
   908                          % (verb, actualhg, expecthg))
   904                          % (verb, actualhg, expecthg))
   909 
   905 
   910 def runchildren(options, tests):
   906 def runchildren(options, tests):