brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.2 KiB · b78c0ea Raw
41 lines · plain
1# -*- Python -*-2import os3import sys4 5import lit.formats6 7config.name = "per_test_timeout"8 9shellType = lit_config.params.get("external", "1")10 11if shellType == "0":12    lit_config.note("Using internal shell")13    externalShell = False14else:15    lit_config.note("Using external shell")16    externalShell = True17 18configSetTimeout = lit_config.params.get("set_timeout", "0")19 20if configSetTimeout != "0":21    # Try setting the max individual test time in the configuration22    lit_config.maxIndividualTestTime = int(configSetTimeout)23 24config.test_format = lit.formats.ShTest(execute_external=externalShell)25config.suffixes = [".py"]26 27config.test_source_root = os.path.dirname(__file__)28config.test_exec_root = config.test_source_root29config.target_triple = "(unused)"30src_root = os.path.join(config.test_source_root, "..")31 32pythonpath_list = [src_root]33# Ensure the user's PYTHONPATH is included.34if "PYTHONPATH" in os.environ:35    pythonpath_list.append(os.environ["PYTHONPATH"])36if "PYTHONPATH" in config.environment:37    pythonpath_list.append(config.environment["PYTHONPATH"])38config.environment["PYTHONPATH"] = os.pathsep.join(pythonpath_list)39 40config.substitutions.append(("%{python}", '"%s"' % (sys.executable)))41