Skip to content
Snippets Groups Projects
Commit 70605ff4 authored by Julian Lettner's avatar Julian Lettner
Browse files

[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.
parent af28e02e
No related branches found
No related tags found
No related merge requests found
...@@ -94,7 +94,7 @@ def main(builtin_params={}): ...@@ -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): ...@@ -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):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment