testrunner: make `-j100 --runs-per-test=100 test-foo.t` use 100 jobs
It would use only 1 job since 1039404c5e1d (run-tests: print number of
tests and parallel process count, 2018-10-13), but I'm pretty sure
that was unintentional.
Differential Revision: https://phab.mercurial-scm.org/D5557
--- a/tests/run-tests.py Sun Jan 06 23:37:13 2019 -0800
+++ b/tests/run-tests.py Thu Jan 10 14:32:36 2019 -0800
@@ -2859,8 +2859,9 @@
testdescs = orig
tests = [self._gettest(d, i) for i, d in enumerate(testdescs)]
-
- jobs = min(len(tests), self.options.jobs)
+ num_tests = len(tests) * self.options.runs_per_test
+
+ jobs = min(num_tests, self.options.jobs)
failed = False
kws = self.options.keywords
@@ -2897,7 +2898,7 @@
self._installchg()
log('running %d tests using %d parallel processes' % (
- len(tests), jobs))
+ num_tests, jobs))
result = runner.run(suite)
--- a/tests/test-run-tests.t Sun Jan 06 23:37:13 2019 -0800
+++ b/tests/test-run-tests.t Thu Jan 10 14:32:36 2019 -0800
@@ -716,6 +716,12 @@
(delete the duplicated test file)
$ rm test-failure-copy.t
+multiple runs per test should be parallelized
+
+ $ rt --jobs 2 --runs-per-test 2 test-success.t
+ running 2 tests using 2 parallel processes
+ ..
+ # Ran 2 tests, 0 skipped, 0 failed.
Interactive run
===============