##// END OF EJS Templates
run-tests: add canonpath function...
timeless -
r28644:2e50eb63 default
parent child Browse files
Show More
@@ -151,6 +151,9 b' defaults = {'
151 'shell': ('HGTEST_SHELL', 'sh'),
151 'shell': ('HGTEST_SHELL', 'sh'),
152 }
152 }
153
153
154 def canonpath(path):
155 return os.path.realpath(os.path.expanduser(path))
156
154 def parselistfiles(files, listtype, warn=True):
157 def parselistfiles(files, listtype, warn=True):
155 entries = dict()
158 entries = dict()
156 for filename in files:
159 for filename in files:
@@ -290,15 +293,14 b' def parseargs(args, parser):'
290 options.pure = True
293 options.pure = True
291
294
292 if options.with_hg:
295 if options.with_hg:
293 options.with_hg = os.path.realpath(
296 options.with_hg = canonpath(_bytespath(options.with_hg))
294 os.path.expanduser(_bytespath(options.with_hg)))
295 if not (os.path.isfile(options.with_hg) and
297 if not (os.path.isfile(options.with_hg) and
296 os.access(options.with_hg, os.X_OK)):
298 os.access(options.with_hg, os.X_OK)):
297 parser.error('--with-hg must specify an executable hg script')
299 parser.error('--with-hg must specify an executable hg script')
298 if not os.path.basename(options.with_hg) == b'hg':
300 if not os.path.basename(options.with_hg) == b'hg':
299 sys.stderr.write('warning: --with-hg should specify an hg script\n')
301 sys.stderr.write('warning: --with-hg should specify an hg script\n')
300 if options.local:
302 if options.local:
301 testdir = os.path.dirname(_bytespath(os.path.realpath(sys.argv[0])))
303 testdir = os.path.dirname(_bytespath(canonpath(sys.argv[0])))
302 hgbin = os.path.join(os.path.dirname(testdir), b'hg')
304 hgbin = os.path.join(os.path.dirname(testdir), b'hg')
303 if os.name != 'nt' and not os.access(hgbin, os.X_OK):
305 if os.name != 'nt' and not os.access(hgbin, os.X_OK):
304 parser.error('--local specified, but %r not found or not executable'
306 parser.error('--local specified, but %r not found or not executable'
@@ -309,8 +311,7 b' def parseargs(args, parser):'
309 parser.error('chg does not work on %s' % os.name)
311 parser.error('chg does not work on %s' % os.name)
310 if options.with_chg:
312 if options.with_chg:
311 options.chg = False # no installation to temporary location
313 options.chg = False # no installation to temporary location
312 options.with_chg = os.path.realpath(
314 options.with_chg = canonpath(_bytespath(options.with_chg))
313 os.path.expanduser(_bytespath(options.with_chg)))
314 if not (os.path.isfile(options.with_chg) and
315 if not (os.path.isfile(options.with_chg) and
315 os.access(options.with_chg, os.X_OK)):
316 os.access(options.with_chg, os.X_OK)):
316 parser.error('--with-chg must specify a chg executable')
317 parser.error('--with-chg must specify a chg executable')
@@ -343,7 +344,7 b' def parseargs(args, parser):'
343 verbose = ''
344 verbose = ''
344
345
345 if options.tmpdir:
346 if options.tmpdir:
346 options.tmpdir = os.path.expanduser(options.tmpdir)
347 options.tmpdir = canonpath(options.tmpdir)
347
348
348 if options.jobs < 1:
349 if options.jobs < 1:
349 parser.error('--jobs must be positive')
350 parser.error('--jobs must be positive')
General Comments 0
You need to be logged in to leave comments. Login now