1 # -*- Python -*- 2 import os 3 import sys 4 5 import lit.formats 6 7 config.name = 'per_test_timeout' 8 9 shellType = lit_config.params.get('external', '1') 10 11 if shellType == '0': 12 lit_config.note('Using internal shell') 13 externalShell = False 14 else: 15 lit_config.note('Using external shell') 16 externalShell = True 17 18 configSetTimeout = lit_config.params.get('set_timeout', '0') 19 20 if configSetTimeout == '1': 21 # Try setting the max individual test time in the configuration 22 lit_config.maxIndividualTestTime = 1 23 24 config.test_format = lit.formats.ShTest(execute_external=externalShell) 25 config.suffixes = ['.py'] 26 27 config.test_source_root = os.path.dirname(__file__) 28 config.test_exec_root = config.test_source_root 29 config.target_triple = '(unused)' 30 src_root = os.path.join(config.test_source_root, '..') 31 config.environment['PYTHONPATH'] = src_root 32 config.substitutions.append(('%{python}', sys.executable)) 33