1 # -*- Python -*- vim: set ft=python ts=4 sw=4 expandtab tw=79:
2 # Configuration file for the 'lit' test runner.
9 # Tell pylint that we know config and lit_config exist somewhere.
10 if 'PYLINT_IMPORT' in os.environ:
14 def append_dynamic_library_path(path):
15 if config.operating_system == 'Windows':
18 elif config.operating_system == 'Darwin':
19 name = 'DYLD_LIBRARY_PATH'
22 name = 'LD_LIBRARY_PATH'
24 if name in config.environment:
25 config.environment[name] = path + sep + config.environment[name]
27 config.environment[name] = path
29 # name: The name of this test suite.
30 config.name = 'OMPT multiplex'
32 # suffixes: A list of file extensions to treat as test files.
33 config.suffixes = ['.c']
35 # test_source_root: The root path where tests are located.
36 config.test_source_root = os.path.dirname(__file__)
38 # test_exec_root: The root object directory where output is placed
39 config.test_exec_root = config.test_obj_root
42 config.test_format = lit.formats.ShTest()
45 config.test_flags = " -I " + config.test_source_root + "/.."\
46 " -I " + config.omp_header_dir + \
47 " -L " + config.omp_library_dir + \
48 " -I " + config.ompt_print_callback_dir + \
49 " -Wl,-rpath," + config.omp_library_dir + \
50 " " + config.test_openmp_flags + \
51 " " + config.test_extra_flags
53 # to run with icc INTEL_LICENSE_FILE must be set
54 if 'INTEL_LICENSE_FILE' in os.environ:
55 config.environment['INTEL_LICENSE_FILE'] = os.environ['INTEL_LICENSE_FILE']
58 config.target_triple = [ ]
59 for feature in config.test_compiler_features:
60 config.available_features.add(feature)
62 # Setup environment to find dynamic library at runtime
63 append_dynamic_library_path(config.omp_library_dir)
64 append_dynamic_library_path(config.test_obj_root+"/..")
66 # Rpath modifications for Darwin
67 if config.operating_system == 'Darwin':
68 config.test_flags += " -Wl,-rpath," + config.omp_library_dir
70 # Find the SDK on Darwin
71 if config.operating_system == 'Darwin':
72 cmd = subprocess.Popen(['xcrun', '--show-sdk-path'],
73 stdout=subprocess.PIPE, stderr=subprocess.PIPE)
74 out, err = cmd.communicate()
78 config.test_flags += " -isysroot " + out
80 if 'Linux' in config.operating_system:
81 config.available_features.add("linux")
84 config.substitutions.append(("FileCheck", "tee %%t.out | %s" % config.test_filecheck))
85 config.substitutions.append(("%sort-threads", "sort --numeric-sort --stable"))
87 config.substitutions.append(("%libomp-compile-and-run", \
88 "%libomp-compile && %libomp-run"))
89 config.substitutions.append(("%libomp-compile", \
90 "%clang %cflags %s -o %t"))
91 config.substitutions.append(("%libomp-tool", \
92 "%clang %cflags -shared -fPIC -g"))
93 config.substitutions.append(("%libomp-run", "%t"))
94 config.substitutions.append(("%clang", config.test_c_compiler))
95 config.substitutions.append(("%openmp_flag", config.test_openmp_flags))
96 config.substitutions.append(("%cflags", config.test_flags))