Show More
@@ -341,7 +341,7 b' class Test(unittest.TestCase):' | |||
|
341 | 341 | def __init__(self, options, path, tmpdir, abort, keeptmpdir=False, |
|
342 | 342 | debug=False, nodiff=False, diffviewer=None, |
|
343 | 343 | interactive=False, timeout=defaults['timeout'], |
|
344 | startport=defaults['port']): | |
|
344 | startport=defaults['port'], extraconfigopts=None): | |
|
345 | 345 | """Create a test from parameters. |
|
346 | 346 | |
|
347 | 347 | options are parsed command line options that control test execution. |
@@ -373,6 +373,10 b' class Test(unittest.TestCase):' | |||
|
373 | 373 | test will reserve 3 port numbers for execution. It is the caller's |
|
374 | 374 | responsibility to allocate a non-overlapping port range to Test |
|
375 | 375 | instances. |
|
376 | ||
|
377 | extraconfigopts is an iterable of extra hgrc config options. Values | |
|
378 | must have the form "key=value" (something understood by hgrc). Values | |
|
379 | of the form "foo.key=value" will result in "[foo] key=value". | |
|
376 | 380 | """ |
|
377 | 381 | |
|
378 | 382 | self.path = path |
@@ -390,6 +394,7 b' class Test(unittest.TestCase):' | |||
|
390 | 394 | self._interactive = interactive |
|
391 | 395 | self._timeout = timeout |
|
392 | 396 | self._startport = startport |
|
397 | self._extraconfigopts = extraconfigopts or [] | |
|
393 | 398 | self._daemonpids = [] |
|
394 | 399 | |
|
395 | 400 | self._finished = None |
@@ -643,12 +648,11 b' class Test(unittest.TestCase):' | |||
|
643 | 648 | hgrc.write('commit = -d "0 0"\n') |
|
644 | 649 | hgrc.write('shelve = --date "0 0"\n') |
|
645 | 650 | hgrc.write('tag = -d "0 0"\n') |
|
646 |
|
|
|
647 | for opt in self._options.extra_config_opt: | |
|
648 | section, key = opt.split('.', 1) | |
|
649 | assert '=' in key, ('extra config opt %s must ' | |
|
650 | 'have an = for assignment' % opt) | |
|
651 | hgrc.write('[%s]\n%s\n' % (section, key)) | |
|
651 | for opt in self._extraconfigopts: | |
|
652 | section, key = opt.split('.', 1) | |
|
653 | assert '=' in key, ('extra config opt %s must ' | |
|
654 | 'have an = for assignment' % opt) | |
|
655 | hgrc.write('[%s]\n%s\n' % (section, key)) | |
|
652 | 656 | hgrc.close() |
|
653 | 657 | |
|
654 | 658 | def fail(self, msg, ret): |
@@ -1517,7 +1521,8 b' class TestRunner(object):' | |||
|
1517 | 1521 | diffviewer=self.options.view, |
|
1518 | 1522 | interactive=self.options.interactive, |
|
1519 | 1523 | timeout=self.options.timeout, |
|
1520 |
startport=self.options.port + count * 3 |
|
|
1524 | startport=self.options.port + count * 3, | |
|
1525 | extraconfigopts=self.options.extra_config_opt) | |
|
1521 | 1526 | |
|
1522 | 1527 | def _cleanup(self): |
|
1523 | 1528 | """Clean up state from this test invocation.""" |
General Comments 0
You need to be logged in to leave comments.
Login now