43 lines · python
1# -*- Python -*-2 3import os4import platform5import re6 7import lit.formats8 9# Only run the tests on supported OSs.10if config.target_os not in ["Linux"]:11 config.unsupported = True12 13 14def get_required_attr(config, attr_name):15 attr_value = getattr(config, attr_name, None)16 if attr_value is None:17 lit_config.fatal(18 "No attribute %r in test configuration! You may need to run "19 "tests from your build directory or add this attribute "20 "to lit.site.cfg.py " % attr_name21 )22 return attr_value23 24 25# Setup config name.26config.name = "CtxProfile" + config.name_suffix27 28# Setup source root.29config.test_source_root = os.path.dirname(__file__)30# Default test suffixes.31config.suffixes = [".c", ".cpp", ".test"]32 33config.substitutions.append(34 ("%clangxx ", " ".join([config.clang] + config.cxx_mode_flags) + " -ldl -lpthread ")35)36 37config.substitutions.append(38 (39 "%ctxprofilelib",40 "-L%s -lclang_rt.ctx_profile%s" % (config.compiler_rt_libdir, config.target_suffix)41 )42)43