Mercurial > hg
comparison tests/run-tests.py @ 40244:1039404c5e1d
run-tests: print number of tests and parallel process count
This seems like a useful output message to have.
I also sneak in a change to lower the parallel process count if it
is larger than the number of tests, as that makes no sense and output
saying we're running more tests in parallel than there exists tests would
be wonky.
Differential Revision: https://phab.mercurial-scm.org/D5070
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Sat, 13 Oct 2018 12:11:45 +0200 |
parents | 0f8ff3ff5d5c |
children | e7e70c033783 |
comparison
equal
deleted
inserted
replaced
40243:96e50dfd8c94 | 40244:1039404c5e1d |
---|---|
2793 print("running all tests") | 2793 print("running all tests") |
2794 testdescs = orig | 2794 testdescs = orig |
2795 | 2795 |
2796 tests = [self._gettest(d, i) for i, d in enumerate(testdescs)] | 2796 tests = [self._gettest(d, i) for i, d in enumerate(testdescs)] |
2797 | 2797 |
2798 jobs = min(len(tests), self.options.jobs) | |
2799 | |
2798 failed = False | 2800 failed = False |
2799 kws = self.options.keywords | 2801 kws = self.options.keywords |
2800 if kws is not None and PYTHON3: | 2802 if kws is not None and PYTHON3: |
2801 kws = kws.encode('utf-8') | 2803 kws = kws.encode('utf-8') |
2802 | 2804 |
2803 suite = TestSuite(self._testdir, | 2805 suite = TestSuite(self._testdir, |
2804 jobs=self.options.jobs, | 2806 jobs=jobs, |
2805 whitelist=self.options.whitelisted, | 2807 whitelist=self.options.whitelisted, |
2806 blacklist=self.options.blacklist, | 2808 blacklist=self.options.blacklist, |
2807 retest=self.options.retest, | 2809 retest=self.options.retest, |
2808 keywords=kws, | 2810 keywords=kws, |
2809 loop=self.options.loop, | 2811 loop=self.options.loop, |
2826 else: | 2828 else: |
2827 self._usecorrectpython() | 2829 self._usecorrectpython() |
2828 if self.options.chg: | 2830 if self.options.chg: |
2829 assert self._installdir | 2831 assert self._installdir |
2830 self._installchg() | 2832 self._installchg() |
2833 | |
2834 log('running %d tests using %d parallel processes' % ( | |
2835 len(tests), jobs)) | |
2831 | 2836 |
2832 result = runner.run(suite) | 2837 result = runner.run(suite) |
2833 | 2838 |
2834 if result.failures: | 2839 if result.failures: |
2835 failed = True | 2840 failed = True |