forked from OSchip/llvm-project
[lit] Push computation of workers into run_tests
This also avoids assigning to the option object.
This commit is contained in:
parent
511868dcf3
commit
3cd6e02920
|
@ -83,8 +83,6 @@ def main(builtin_params={}):
|
||||||
|
|
||||||
filtered_tests = filtered_tests[:opts.max_tests]
|
filtered_tests = filtered_tests[:opts.max_tests]
|
||||||
|
|
||||||
opts.workers = min(len(filtered_tests), opts.workers)
|
|
||||||
|
|
||||||
start = time.time()
|
start = time.time()
|
||||||
run_tests(filtered_tests, lit_config, opts, len(discovered_tests))
|
run_tests(filtered_tests, lit_config, opts, len(discovered_tests))
|
||||||
elapsed = time.time() - start
|
elapsed = time.time() - start
|
||||||
|
@ -190,14 +188,16 @@ def filter_by_shard(tests, run, shards, lit_config):
|
||||||
|
|
||||||
|
|
||||||
def run_tests(tests, lit_config, opts, discovered_tests):
|
def run_tests(tests, lit_config, opts, discovered_tests):
|
||||||
|
workers = min(len(tests), opts.workers)
|
||||||
display = lit.display.create_display(opts, len(tests), discovered_tests,
|
display = lit.display.create_display(opts, len(tests), discovered_tests,
|
||||||
opts.workers)
|
workers)
|
||||||
|
|
||||||
def progress_callback(test):
|
def progress_callback(test):
|
||||||
display.update(test)
|
display.update(test)
|
||||||
if opts.order == 'failing-first':
|
if opts.order == 'failing-first':
|
||||||
touch_file(test)
|
touch_file(test)
|
||||||
|
|
||||||
run = lit.run.Run(tests, lit_config, opts.workers, progress_callback,
|
run = lit.run.Run(tests, lit_config, workers, progress_callback,
|
||||||
opts.max_failures, opts.timeout)
|
opts.max_failures, opts.timeout)
|
||||||
|
|
||||||
display.print_header()
|
display.print_header()
|
||||||
|
|
Loading…
Reference in New Issue