diff options
author | Carlos Garcia Campos <carlosgc@gnome.org> | 2012-12-08 18:57:07 +0100 |
---|---|---|
committer | Carlos Garcia Campos <carlosgc@gnome.org> | 2012-12-08 18:57:07 +0100 |
commit | 8cd5cae953de374276c11711dc106de15c8dcad0 (patch) | |
tree | 1f2c178f5b7c6410a8127efb93ba9af053c98e8c /regtest | |
parent | 605c363b04ba3853883010c0a413054fe246d9aa (diff) |
regtest: Use the number of cpus as default number of worker threads
Diffstat (limited to 'regtest')
-rw-r--r-- | regtest/main.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/regtest/main.py b/regtest/main.py index 7b42f480..41ce4544 100644 --- a/regtest/main.py +++ b/regtest/main.py @@ -41,6 +41,8 @@ class HelpAction(argparse.Action): sys.exit(0) def main(args): + n_cpus = cpu_count() + parser = argparse.ArgumentParser( description = 'Poppler regression tests', prog = 'poppler-regtest', @@ -64,8 +66,8 @@ def main(args): action = 'store', dest = 'skipped_file', help = 'File containing tests to skip') parser.add_argument('-t', '--threads', - action = 'store', dest = 'threads', type = int, default = 1, - help = 'Number of worker threads') + action = 'store', dest = 'threads', type = int, default = n_cpus, + help = 'Number of worker threads (Default: %d)' % n_cpus) ns, args = parser.parse_known_args(args) if not args: @@ -75,7 +77,7 @@ def main(args): c = Config(vars(ns)) if c.threads <= 0: - c.threads = cpu_count() - c.threads + c.threads = n_cpus - c.threads try: commands.run(args) |