comparison tests/run-tests.py @ 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 643381286e0c
children 38e387a64f58
comparison
equal deleted inserted replaced
14133:28085b82f801 14134:8468ec1109d1
163 metavar="HG", 163 metavar="HG",
164 help="test using specified hg script rather than a " 164 help="test using specified hg script rather than a "
165 "temporary installation") 165 "temporary installation")
166 parser.add_option("-3", "--py3k-warnings", action="store_true", 166 parser.add_option("-3", "--py3k-warnings", action="store_true",
167 help="enable Py3k warnings on Python 2.6+") 167 help="enable Py3k warnings on Python 2.6+")
168 parser.add_option('--extra-config-opt', action="append",
169 help='set the given config opt in the test hgrc')
168 170
169 for option, default in defaults.items(): 171 for option, default in defaults.items():
170 defaults[option] = int(os.environ.get(*default)) 172 defaults[option] = int(os.environ.get(*default))
171 parser.set_defaults(**defaults) 173 parser.set_defaults(**defaults)
172 (options, args) = parser.parse_args() 174 (options, args) = parser.parse_args()
752 hgrc.write('[extensions]\n') 754 hgrc.write('[extensions]\n')
753 hgrc.write('inotify=\n') 755 hgrc.write('inotify=\n')
754 hgrc.write('[inotify]\n') 756 hgrc.write('[inotify]\n')
755 hgrc.write('pidfile=%s\n' % DAEMON_PIDS) 757 hgrc.write('pidfile=%s\n' % DAEMON_PIDS)
756 hgrc.write('appendpid=True\n') 758 hgrc.write('appendpid=True\n')
759 if options.extra_config_opt:
760 for opt in options.extra_config_opt:
761 section, key = opt.split('.', 1)
762 assert '=' in key, ('extra config opt %s must '
763 'have an = for assignment' % opt)
764 hgrc.write('[%s]\n%s\n' % (section, key))
757 hgrc.close() 765 hgrc.close()
758 766
759 ref = os.path.join(TESTDIR, test+".out") 767 ref = os.path.join(TESTDIR, test+".out")
760 err = os.path.join(TESTDIR, test+".err") 768 err = os.path.join(TESTDIR, test+".err")
761 if os.path.exists(err): 769 if os.path.exists(err):