summaryrefslogtreecommitdiffstats
path: root/openmp/runtime/test/lit.cfg
blob: 5529c4745d9e703c4646863b743de17b80f98c48 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# -*- Python -*- vim: set ft=python ts=4 sw=4 expandtab tw=79:
# Configuration file for the 'lit' test runner.

import os
import lit.formats

# Tell pylint that we know config and lit_config exist somewhere.
if 'PYLINT_IMPORT' in os.environ:
    config = object()
    lit_config = object()

def append_dynamic_library_path(name, value, sep):
    if name in config.environment:
        config.environment[name] = value + sep + config.environment[name]
    else:
        config.environment[name] = value

# name: The name of this test suite.
config.name = 'libomp'

# suffixes: A list of file extensions to treat as test files.
config.suffixes = ['.c']

# test_source_root: The root path where tests are located.
config.test_source_root = os.path.dirname(__file__)

# test_exec_root: The root object directory where output is placed
config.test_exec_root = config.libomp_obj_root

# test format
config.test_format = lit.formats.ShTest()

# compiler flags
config.test_cflags = config.test_openmp_flag + \
    " -I " + config.test_source_root + \
    " -I " + config.omp_header_directory + \
    " -L " + config.library_dir + \
    " " + config.test_extra_cflags

# Setup environment to find dynamic library at runtime
if config.operating_system == 'Windows':
    append_dynamic_library_path('PATH', config.library_dir, ";")
elif config.operating_system == 'Darwin':
    append_dynamic_library_path('DYLD_LIBRARY_PATH', config.library_dir, ":")
    config.test_cflags += " -Wl,-rpath," + config.library_dir
else: # Unices
    append_dynamic_library_path('LD_LIBRARY_PATH', config.library_dir, ":")

# substitutions
config.substitutions.append(("%libomp-compile-and-run", \
    "%clang %cflags %s -o %t -lm && %t"))
config.substitutions.append(("%clang", config.test_compiler))
config.substitutions.append(("%openmp_flag", config.test_openmp_flag))
config.substitutions.append(("%cflags", config.test_cflags))

OpenPOWER on IntegriCloud