Commit 744dbf5f authored by Julien Muchembled's avatar Julien Muchembled

qa: new --loop runner option

parent 00ea89c3
...@@ -229,6 +229,8 @@ class TestRunner(BenchmarkRunner): ...@@ -229,6 +229,8 @@ class TestRunner(BenchmarkRunner):
parser.add_option('-C', '--cov-unit', action='store_true', parser.add_option('-C', '--cov-unit', action='store_true',
help='Same as -c but output 1 file per test,' help='Same as -c but output 1 file per test,'
' in the temporary test directory') ' in the temporary test directory')
parser.add_option('-l', '--loop', type='int', default=1,
help='Repeat tests several times')
parser.add_option('-f', '--functional', action='store_true', parser.add_option('-f', '--functional', action='store_true',
help='Functional tests') help='Functional tests')
parser.add_option('-u', '--unit', action='store_true', parser.add_option('-u', '--unit', action='store_true',
...@@ -271,6 +273,7 @@ Environment Variables: ...@@ -271,6 +273,7 @@ Environment Variables:
sys.exit('Nothing to run, please give one of -f, -u, -z') sys.exit('Nothing to run, please give one of -f, -u, -z')
options.unit = options.functional = options.zodb = True options.unit = options.functional = options.zodb = True
return dict( return dict(
loop = options.loop,
unit = options.unit, unit = options.unit,
functional = options.functional, functional = options.functional,
zodb = options.zodb, zodb = options.zodb,
...@@ -301,6 +304,7 @@ Environment Variables: ...@@ -301,6 +304,7 @@ Environment Variables:
del self.__coverage del self.__coverage
orig(self, success) orig(self, success)
try: try:
for _ in xrange(config.loop):
if config.unit: if config.unit:
runner.run('Unit tests', UNIT_TEST_MODULES, only) runner.run('Unit tests', UNIT_TEST_MODULES, only)
if config.functional: if config.functional:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment