| 1 |
# -*- Python -*- vim: set ft=python ts=4 sw=4 expandtab tw=79: |
| 2 |
# Configuration file for the 'lit' test runner. |
| 3 |
|
| 4 |
import os |
| 5 |
import re |
| 6 |
import subprocess |
| 7 |
import lit.formats |
| 8 |
|
| 9 |
# Tell pylint that we know config and lit_config exist somewhere. |
| 10 |
if 'PYLINT_IMPORT' in os.environ: |
| 11 |
config = object() |
| 12 |
lit_config = object() |
| 13 |
|
| 14 |
def append_dynamic_library_path(path): |
| 15 |
if config.operating_system == 'Windows': |
| 16 |
name = 'PATH' |
| 17 |
sep = ';' |
| 18 |
elif config.operating_system == 'Darwin': |
| 19 |
name = 'DYLD_LIBRARY_PATH' |
| 20 |
sep = ':' |
| 21 |
else: |
| 22 |
name = 'LD_LIBRARY_PATH' |
| 23 |
sep = ':' |
| 24 |
if name in config.environment: |
| 25 |
config.environment[name] = path + sep + config.environment[name] |
| 26 |
else: |
| 27 |
config.environment[name] = path |
| 28 |
# config.environment['PYTHONPATH'] = config.ompd_module + sep + config.environment['PYTHON_PATH'] |
| 29 |
|
| 30 |
# name: The name of this test suite. |
| 31 |
config.name = 'ompd-test' |
| 32 |
|
| 33 |
# suffixes: A list of file extensions to treat as test files. |
| 34 |
config.suffixes = ['.c'] |
| 35 |
|
| 36 |
# test_source_root: The root path where tests are located. |
| 37 |
#config.test_source_root = os.path.dirname(__file__) |
| 38 |
config.test_source_root = config.ompd_test_src |
| 39 |
|
| 40 |
# test_exec_root: The root object directory where output is placed |
| 41 |
config.test_exec_root = config.ompd_obj_root |
| 42 |
|
| 43 |
# test format |
| 44 |
config.test_format = lit.formats.ShTest() |
| 45 |
|
| 46 |
# compiler flags |
| 47 |
config.test_flags = " -I " + config.test_source_root + " -I " + config.ompt_include_dir + \ |
| 48 |
" " + config.test_extra_flags + " -L " + config.library_dir |
| 49 |
|
| 50 |
append_dynamic_library_path(config.library_dir) |
| 51 |
append_dynamic_library_path(config.ompd_library_dir) |
| 52 |
|
| 53 |
# Disable OMPT tests if FileCheck was not found |
| 54 |
if config.test_filecheck == "": |
| 55 |
lit_config.note("Not testing OMPT_OMPD because FileCheck was not found") |
| 56 |
|
| 57 |
if 'Linux' in config.operating_system: |
| 58 |
config.available_features.add("linux") |
| 59 |
|
| 60 |
# to run with icc INTEL_LICENSE_FILE must be set |
| 61 |
if 'INTEL_LICENSE_FILE' in os.environ: |
| 62 |
config.environment['INTEL_LICENSE_FILE'] = os.environ['INTEL_LICENSE_FILE'] |
| 63 |
if 'OMP_NUM_THREADS' in os.environ: |
| 64 |
config.environment['OMP_NUM_THREADS'] = os.environ['OMP_NUM_THREADS'] |
| 65 |
#config.environment['ompd'] = "/home/gu620893/LLVM-openmp-master/install/" |
| 66 |
|
| 67 |
config.substitutions.append(("%gdb-compile-and-run", "%gdb-compile && %gdb-run")) |
| 68 |
|
| 69 |
config.substitutions.append(("%gdb-compile", |
| 70 |
"%test_c_compiler -fopenmp -g -gdwarf-4 %s -o %t " + config.test_flags)) |
| 71 |
config.substitutions.append(("%test_c_compiler", config.test_c_compiler)) |
| 72 |
config.substitutions.append(("%gdb-run", |
| 73 |
"env OMP_DEBUG=enabled gdb -x " + config.ompd_obj_root + "/../gdb-plugin/python-module/ompd/__init__.py -x " \ |
| 74 |
+ config.ompd_test_src + "/test.cmd %t ")) |
| 75 |
|
| 76 |
config.substitutions.append(("%gdb-test", |
| 77 |
"env OMP_DEBUG=enabled gdb -x " + config.ompd_obj_root + "/../gdb-plugin/python-module/ompd/__init__.py ")) |
| 78 |
|
| 79 |
config.substitutions.append(("%ompt-tool", |
| 80 |
config.ompt_plugin)) |
| 81 |
|
| 82 |
config.substitutions.append(("FileCheck", config.test_filecheck)) |
| 83 |
|