--- a/tests/run-tests.py Sun May 01 18:18:31 2011 +0100
+++ b/tests/run-tests.py Fri May 06 20:13:10 2011 +0200
@@ -104,6 +104,7 @@
'jobs': ('HGTEST_JOBS', 1),
'timeout': ('HGTEST_TIMEOUT', 180),
'port': ('HGTEST_PORT', 20059),
+ 'shell': ('HGTEST_SHELL', '/bin/sh'),
}
def parseargs():
@@ -149,6 +150,8 @@
help="retest failed tests")
parser.add_option("-S", "--noskips", action="store_true",
help="don't report skip tests verbosely")
+ parser.add_option("--shell", type="string",
+ help="shell to use (default: $%s or %s)" % defaults['shell'])
parser.add_option("-t", "--timeout", type="int",
help="kill errant tests after TIMEOUT seconds"
" (default: $%s or %d)" % defaults['timeout'])
@@ -168,8 +171,8 @@
parser.add_option('--extra-config-opt', action="append",
help='set the given config opt in the test hgrc')
- for option, default in defaults.items():
- defaults[option] = int(os.environ.get(*default))
+ for option, (envvar, default) in defaults.items():
+ defaults[option] = type(default)(os.environ.get(envvar, default))
parser.set_defaults(**defaults)
(options, args) = parser.parse_args()
@@ -177,6 +180,10 @@
if 'java' in sys.platform or '__pypy__' in sys.modules:
options.pure = True
+ if not (os.path.isfile(options.shell) and
+ os.access(options.shell, os.X_OK)):
+ parser.error('--shell must be executable')
+
if options.with_hg:
if not (os.path.isfile(options.with_hg) and
os.access(options.with_hg, os.X_OK)):
@@ -527,7 +534,7 @@
os.write(fd, l)
os.close(fd)
- cmd = '/bin/sh "%s"' % name
+ cmd = '"%s" "%s"' % (options.shell, name)
vlog("# Running", cmd)
exitcode, output = run(cmd, wd, options, replacements)
# do not merge output if skipped, return hghave message instead
@@ -917,6 +924,9 @@
name = '--' + opt.replace('_', '-')
if value is True:
opts.append(name)
+ elif isinstance(value, list):
+ for v in value:
+ opts.append(name + '=' + str(v))
elif value is not None:
opts.append(name + '=' + str(value))