[PR] LIT: add checking if maxIndividualTestTime is availabe on the platform

Summary:
This commit adds checking if maxIndividualTestTime is availabe on
the platform. If available - it sets per test timeout to 60sec and
declares lit-max-individual-test-time feature for further checking
by particular test cases.
Based on https://reviews.llvm.org/D64251 implementation.

Vasily Leonenko,
Advanced Software Technology Lab, Huawei

(cherry picked from FBD30821986)
This commit is contained in:
Vasily Leonenko 2021-08-27 21:56:24 +03:00 committed by Maksim Panchenko
parent 856299594c
commit e2480fcc98
1 changed files with 11 additions and 0 deletions

View File

@ -39,6 +39,17 @@ config.test_source_root = os.path.dirname(__file__)
# test_exec_root: The root path where tests should be run.
config.test_exec_root = os.path.join(config.bolt_obj_root, 'test')
# checking if maxIndividualTestTime is available on the platform and sets
# it to 60sec if so, declares lit-max-individual-test-time feature for
# further checking by tests.
supported, errormsg = lit_config.maxIndividualTestTimeIsSupported
if supported:
config.available_features.add("lit-max-individual-test-time")
lit_config.maxIndividualTestTime = 60
else:
lit_config.warning('Setting a timeout per test not supported. ' + errormsg
+ ' Some tests will be skipped.')
llvm_config.use_default_substitutions()
config.substitutions.append(('%host_cc', config.host_cc))