summaryrefslogtreecommitdiffstats
path: root/openmp/testsuite/bin/lit.cfg
blob: 195781989e5afe3d682a47c0388b5c34ade48d45 (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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# -*- Python -*-

# Configuration file for the 'lit' test runner.

import os
import sys
import re
import platform

try:
   import lit.util
   import lit.formats
except ImportError:
   pass

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

# testFormat: The test format to use to interpret tests.
config.test_format = lit.formats.ShTest(execute_external=False)

# suffixes: A list of file extensions to treat as test files
# Note this can be overridden by lit.local.cfg files
config.suffixes = ['.ll']

# test_source_root: The root path where tests are located.
#config.test_source_root = "/home/ichoyjx/install/openmp/testsuite/bin"
#os.path.dirname(__file__)

# test_exec_root: The root path where tests should be run.
#mpvs_obj_root = getattr(config, 'mpvs_obj_root', None)
#if mpvs_obj_root is not None:
config.test_exec_root = "./"
#os.path.join(mpvs_obj_root, 'src')

# Discover the 'clang' and 'clangcc' to use.

import os

def inferClang(PATH):
    # Determine which clang to use.
    clang = os.getenv('CLANG')

    # If the user set clang in the environment, definitely use that and don't
    # try to validate.
    if clang:
        return clang

    # Otherwise look in the path.
    clang = lit.util.which('clang', PATH)

    if not clang:
        lit_config.fatal("couldn't find 'clang' program, try setting "
                         "CLANG in your environment")

    return clang

config.clang = inferClang(config.environment['PATH']).replace('\\', '/')
config.substitutions.append( ('%clang', ' ' + config.clang + ' ') )

# Propogate some environment variable to test environment.
def addEnv(name):
    if name in os.environ:
        config.environment[name] = os.environ[name]

addEnv('HOME')
addEnv('PWD')


addEnv('C_INCLUDE_PATH')
addEnv('CPLUS_INCLUDE_PATH')
addEnv('LIBRARY_PATH')
addEnv('LD_LIBRARY_PATH')
addEnv('DYLD_LIBRARY_PATH')

# Check that the object root is known.
if config.test_exec_root is None:
    lit.fatal('test execution root not set!')
OpenPOWER on IntegriCloud