1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 10:42:39 +01:00

[NFC][lit] discovery: find_tests_for_inputs: avoid py warning when no suites found

If lit was run on a directory that contained no suites,
then naturally suite[0] will not be there,
and that line would cause python warnings.

So just predicate it with a check that it is there in the first place.
This commit is contained in:
Roman Lebedev 2021-03-22 12:26:07 +03:00
parent aa081d2756
commit 866f214e22

View File

@ -284,7 +284,8 @@ def find_tests_for_inputs(lit_config, inputs, indirectlyRunCheck):
# This data is no longer needed but keeping it around causes awful # This data is no longer needed but keeping it around causes awful
# performance problems while the test suites run. # performance problems while the test suites run.
for k, suite in test_suite_cache.items(): for k, suite in test_suite_cache.items():
suite[0].test_times = None if suite[0]:
suite[0].test_times = None
# If there were any errors during test discovery, exit now. # If there were any errors during test discovery, exit now.
if lit_config.numErrors: if lit_config.numErrors: