mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-10-19 11:02:59 +02:00
[lit] Don't crash for --time-tests in aborted test run
Properly print the test times histogram even for aborted (user interrupt, [Ctrl+C]) test runs.
This commit is contained in:
parent
8760dcd6cf
commit
5f254f88ba
@ -94,7 +94,7 @@ def main(builtin_params={}):
|
|||||||
t for t in selected_tests if t.result.code != lit.Test.SKIPPED]
|
t for t in selected_tests if t.result.code != lit.Test.SKIPPED]
|
||||||
|
|
||||||
if opts.time_tests:
|
if opts.time_tests:
|
||||||
print_histogram(executed_tests)
|
print_histogram(discovered_tests)
|
||||||
|
|
||||||
print_results(discovered_tests, elapsed, opts)
|
print_results(discovered_tests, elapsed, opts)
|
||||||
|
|
||||||
@ -257,8 +257,10 @@ def execute_in_tmp_dir(run, lit_config):
|
|||||||
|
|
||||||
|
|
||||||
def print_histogram(tests):
|
def print_histogram(tests):
|
||||||
test_times = [(t.getFullName(), t.result.elapsed) for t in tests]
|
test_times = [(t.getFullName(), t.result.elapsed)
|
||||||
lit.util.printHistogram(test_times, title='Tests')
|
for t in tests if t.result.elapsed]
|
||||||
|
if test_times:
|
||||||
|
lit.util.printHistogram(test_times, title='Tests')
|
||||||
|
|
||||||
|
|
||||||
def add_result_category(result_code, label):
|
def add_result_category(result_code, label):
|
||||||
|
Loading…
Reference in New Issue
Block a user