blob: 195781989e5afe3d682a47c0388b5c34ade48d45 [file] [log] [blame]
Andrey Churbanova951e212015-04-29 14:36:38 +00001# -*- Python -*-
2
3# Configuration file for the 'lit' test runner.
4
5import os
6import sys
7import re
8import platform
9
10try:
11 import lit.util
12 import lit.formats
13except ImportError:
14 pass
15
16# name: The name of this test suite.
17config.name = 'OpenMPValidationSuite'
18
19# testFormat: The test format to use to interpret tests.
20config.test_format = lit.formats.ShTest(execute_external=False)
21
22# suffixes: A list of file extensions to treat as test files
23# Note this can be overridden by lit.local.cfg files
24config.suffixes = ['.ll']
25
26# test_source_root: The root path where tests are located.
27#config.test_source_root = "/home/ichoyjx/install/openmp/testsuite/bin"
28#os.path.dirname(__file__)
29
30# test_exec_root: The root path where tests should be run.
31#mpvs_obj_root = getattr(config, 'mpvs_obj_root', None)
32#if mpvs_obj_root is not None:
33config.test_exec_root = "./"
34#os.path.join(mpvs_obj_root, 'src')
35
36# Discover the 'clang' and 'clangcc' to use.
37
38import os
39
40def inferClang(PATH):
41 # Determine which clang to use.
42 clang = os.getenv('CLANG')
43
44 # If the user set clang in the environment, definitely use that and don't
45 # try to validate.
46 if clang:
47 return clang
48
49 # Otherwise look in the path.
50 clang = lit.util.which('clang', PATH)
51
52 if not clang:
53 lit_config.fatal("couldn't find 'clang' program, try setting "
54 "CLANG in your environment")
55
56 return clang
57
58config.clang = inferClang(config.environment['PATH']).replace('\\', '/')
59config.substitutions.append( ('%clang', ' ' + config.clang + ' ') )
60
61# Propogate some environment variable to test environment.
62def addEnv(name):
63 if name in os.environ:
64 config.environment[name] = os.environ[name]
65
66addEnv('HOME')
67addEnv('PWD')
68
69
70addEnv('C_INCLUDE_PATH')
71addEnv('CPLUS_INCLUDE_PATH')
72addEnv('LIBRARY_PATH')
73addEnv('LD_LIBRARY_PATH')
74addEnv('DYLD_LIBRARY_PATH')
75
76# Check that the object root is known.
77if config.test_exec_root is None:
78 lit.fatal('test execution root not set!')