diff options
| author | Jeff Epler <jepler@gmail.com> | 2018-03-31 09:38:25 -0500 |
|---|---|---|
| committer | Jeff Epler <jepler@gmail.com> | 2018-03-31 10:38:54 -0500 |
| commit | c2b85296984d0c65abff44810b1e8b1d99981218 (patch) | |
| tree | ecf087b49ec1a768905e63b98369736a591192a6 | |
| parent | a3309ebb809ba8f881d837aaef4997e2adab928a (diff) | |
run-tests: automatically parallelism based on CPU (thread) count
| -rwxr-xr-x | tests/run-tests | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/run-tests b/tests/run-tests index 59b45d695..1e4001bc1 100755 --- a/tests/run-tests +++ b/tests/run-tests @@ -7,6 +7,7 @@ import platform import argparse import re import threading +import multiprocessing from multiprocessing.pool import ThreadPool from glob import glob @@ -488,6 +489,7 @@ def main(): cmd_parser.add_argument('--via-mpy', action='store_true', help='compile .py files to .mpy first') cmd_parser.add_argument('--keep-path', action='store_true', help='do not clear MICROPYPATH when running tests') cmd_parser.add_argument('-j', '--jobs', default=1, metavar='N', type=int, help='Number of tests to run simultaneously') + cmd_parser.add_argument('--auto-jobs', action='store_const', dest='jobs', const=multiprocessing.cpu_count(), help='Set the -j values to the CPU (thread) count') cmd_parser.add_argument('files', nargs='*', help='input test files') args = cmd_parser.parse_args() |
