mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-25 15:01:07 +00: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]
|
||||
|
||||
if opts.time_tests:
|
||||
print_histogram(executed_tests)
|
||||
print_histogram(discovered_tests)
|
||||
|
||||
print_results(discovered_tests, elapsed, opts)
|
||||
|
||||
@ -257,8 +257,10 @@ def execute_in_tmp_dir(run, lit_config):
|
||||
|
||||
|
||||
def print_histogram(tests):
|
||||
test_times = [(t.getFullName(), t.result.elapsed) for t in tests]
|
||||
lit.util.printHistogram(test_times, title='Tests')
|
||||
test_times = [(t.getFullName(), t.result.elapsed)
|
||||
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):
|
||||
|
Loading…
x
Reference in New Issue
Block a user