Mercurial > hg-stable
changeset 14134:8468ec1109d1
run-tests: add flag to provide extra hgrc options for test runs
author | Augie Fackler <durin42@gmail.com> |
---|---|
date | Sun, 01 May 2011 08:00:25 -0500 |
parents | 28085b82f801 |
children | 673abd432104 1618c4f6f15b |
files | tests/run-tests.py |
diffstat | 1 files changed, 8 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/tests/run-tests.py Sun May 01 15:51:52 2011 +0200 +++ b/tests/run-tests.py Sun May 01 08:00:25 2011 -0500 @@ -165,6 +165,8 @@ "temporary installation") parser.add_option("-3", "--py3k-warnings", action="store_true", help="enable Py3k warnings on Python 2.6+") + 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)) @@ -754,6 +756,12 @@ hgrc.write('[inotify]\n') hgrc.write('pidfile=%s\n' % DAEMON_PIDS) hgrc.write('appendpid=True\n') + if options.extra_config_opt: + for opt in options.extra_config_opt: + section, key = opt.split('.', 1) + assert '=' in key, ('extra config opt %s must ' + 'have an = for assignment' % opt) + hgrc.write('[%s]\n%s\n' % (section, key)) hgrc.close() ref = os.path.join(TESTDIR, test+".out")