xref: /llvm-project/compiler-rt/test/ctx_profile/lit.cfg.py (revision 0af6c304e48e0484672b53be49a15f411d173e59)
1# -*- Python -*-
2
3import os
4import platform
5import re
6
7import lit.formats
8
9# Only run the tests on supported OSs.
10if config.host_os not in ["Linux"]:
11    config.unsupported = True
12
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_name
21        )
22    return attr_value
23
24
25# Setup config name.
26config.name = "CtxProfile" + config.name_suffix
27
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