Mercurial > hg
comparison tests/run-tests.py @ 29583:6ce870dba6fa
run-tests: make --local set --with-chg if --chg is used
--local should work with chg as well.
author | Jun Wu <quark@fb.com> |
---|---|
date | Mon, 18 Jul 2016 08:55:30 +0100 |
parents | ee96d95e81a4 |
children | 270b077d434b |
comparison
equal
deleted
inserted
replaced
29582:ee96d95e81a4 | 29583:6ce870dba6fa |
---|---|
212 parser.add_option("--keep-tmpdir", action="store_true", | 212 parser.add_option("--keep-tmpdir", action="store_true", |
213 help="keep temporary directory after running tests") | 213 help="keep temporary directory after running tests") |
214 parser.add_option("-k", "--keywords", | 214 parser.add_option("-k", "--keywords", |
215 help="run tests matching keywords") | 215 help="run tests matching keywords") |
216 parser.add_option("-l", "--local", action="store_true", | 216 parser.add_option("-l", "--local", action="store_true", |
217 help="shortcut for --with-hg=<testdir>/../hg") | 217 help="shortcut for --with-hg=<testdir>/../hg, " |
218 "and --with-chg=<testdir>/../contrib/chg/chg if --chg is set") | |
218 parser.add_option("--loop", action="store_true", | 219 parser.add_option("--loop", action="store_true", |
219 help="loop tests repeatedly") | 220 help="loop tests repeatedly") |
220 parser.add_option("--runs-per-test", type="int", dest="runs_per_test", | 221 parser.add_option("--runs-per-test", type="int", dest="runs_per_test", |
221 help="run each test N times (default=1)", default=1) | 222 help="run each test N times (default=1)", default=1) |
222 parser.add_option("-n", "--nodiff", action="store_true", | 223 parser.add_option("-n", "--nodiff", action="store_true", |
308 sys.stderr.write('warning: --with-hg should specify an hg script\n') | 309 sys.stderr.write('warning: --with-hg should specify an hg script\n') |
309 if options.local: | 310 if options.local: |
310 testdir = os.path.dirname(_bytespath(canonpath(sys.argv[0]))) | 311 testdir = os.path.dirname(_bytespath(canonpath(sys.argv[0]))) |
311 reporootdir = os.path.dirname(testdir) | 312 reporootdir = os.path.dirname(testdir) |
312 pathandattrs = [(b'hg', 'with_hg')] | 313 pathandattrs = [(b'hg', 'with_hg')] |
314 if options.chg: | |
315 pathandattrs.append((b'contrib/chg/chg', 'with_chg')) | |
313 for relpath, attr in pathandattrs: | 316 for relpath, attr in pathandattrs: |
314 binpath = os.path.join(reporootdir, relpath) | 317 binpath = os.path.join(reporootdir, relpath) |
315 if os.name != 'nt' and not os.access(binpath, os.X_OK): | 318 if os.name != 'nt' and not os.access(binpath, os.X_OK): |
316 parser.error('--local specified, but %r not found or ' | 319 parser.error('--local specified, but %r not found or ' |
317 'not executable' % binpath) | 320 'not executable' % binpath) |