Lines Matching +full:add +full:- +full:to +full:- +full:path
1 # -*- Python -*-
17 # Tweak PATH for Win32
19 # Seek sane tools in directories and set to $PATH.
20 path = getattr(config, 'lit_tools_dir', None)
21 path = lit_config.getToolsPath(path,
22 config.environment['PATH'],
24 if path is not None:
25 path = os.path.pathsep.join((path,
26 config.environment['PATH']))
27 config.environment['PATH'] = path
36 # Otherwise we default to internal on Windows and external elsewhere, as
40 # testFormat: The test format to use to interpret tests.
46 # suffixes: A list of file extensions to treat as test files.
49 # excludes: A list of directories to exclude from the testsuite. The 'Inputs'
54 # test_source_root: The root path where tests are located.
55 config.test_source_root = os.path.dirname(__file__)
57 # test_exec_root: The root path where tests should be run.
60 config.test_exec_root = os.path.join(clang_obj_root, 'test')
70 # simply to run the tests at all.
87 # Clang/Win32 may refer to %INCLUDE%. vsvarsall.bat sets it.
94 # Tweak the PATH to include the tools dir and the scripts dir.
102 path = os.path.pathsep.join((
103 clang_tools_dir, llvm_tools_dir, config.environment['PATH']))
104 config.environment['PATH'] = path
108 path = os.path.pathsep.join((llvm_libs_dir,
110 config.environment['LD_LIBRARY_PATH'] = path
112 # Propagate path to symbolizer for ASan/MSan.
122 # probably trying to run on a test file directly, and either the site
124 # out-of-tree build situation).
128 if site_cfg and os.path.exists(site_cfg):
132 # Try to detect the situation where we are using an out-of-tree build by
133 # looking for 'llvm-config'.
135 # FIXME: I debated (i.e., wrote and threw away) adding logic to
137 # build situation. This means knowing how to invoke the build system though,
141 llvm_config = lit.util.which('llvm-config', config.environment['PATH'])
146 llvm_src_root = lit.util.capture(['llvm-config', '--src-root']).strip()
147 llvm_obj_root = lit.util.capture(['llvm-config', '--obj-root']).strip()
148 clang_src_root = os.path.join(llvm_src_root, "tools", "clang")
149 clang_obj_root = os.path.join(llvm_obj_root, "tools", "clang")
151 # Validate that we got a tree which points to here, using the standard
153 this_src_root = os.path.dirname(config.test_source_root)
154 if os.path.realpath(clang_src_root) != os.path.realpath(this_src_root):
158 site_cfg = os.path.join(clang_obj_root, 'test', 'lit.site.cfg')
159 if not os.path.exists(site_cfg):
161 'No site specific configuration available! You may need to '
165 lit_config.note('using out-of-tree build at %r' % clang_obj_root)
171 # Discover the 'clang' and 'clangcc' to use.
175 def inferClang(PATH):
176 # Determine which clang to use.
180 # try to validate.
184 # Otherwise look in the path.
185 clang = lit.util.which('clang', PATH)
193 config.clang = inferClang(config.environment['PATH']).replace('\\', '/')
205 config.available_features.add('plugins')
209 config.substitutions.append( ('%PATH%', config.environment['PATH']) )
212 config.available_features.add('examples')
216 # Clang relies on the driver to locate them.
219 # out its resource dir here in an easy to scrape form.
220 cmd = subprocess.Popen([clang, '-print-file-name=include'],
227 # Don't pass dosish path separator to msys bash.exe.
229 # Ensure the result is an ascii string, across Python2.5+ - Python3.
233 m = re.match(r'(\w+)-(\w+)-(\w+)', triple)
237 # All non-win32 triples use the Itanium ABI.
239 return m.group(1) + '-' + m.group(2) + '-mingw32'
242 m = re.match(r'(\w+)-(\w+)-(\w+)', triple)
253 return isa + '-' + vendor + '-win32'
254 # -win32 is not supported for non-x86 targets; use a default.
255 return 'i686-pc-win32'
258 '%s -cc1 -internal-isystem %s -nostdsysteminc'
262 ' --driver-mode=cpp '))
264 ' --driver-mode=cl '))
266 ' --driver-mode=g++ '))
275 …config.substitutions.append( ('%target_itanium_abi_host_triple', '--target=%s' % makeItaniumABITri…
279 # FIXME: Find nicer way to prohibit this.
285 (' clang-cc ',
286 """*** Do not use 'clang-cc' in tests, use '%clang_cc1'. ***""") )
288 (' clang -cc1 ',
289 """*** Do not use 'clang -cc1' in tests, use '%clang_cc1'. ***""") )
291 (' %clang-cc1 ',
294 (' %clang-cpp ',
297 (' %clang-cl ',
301 # with the full path to the build directory holding that tool. This
303 # tools that might happen to be in the user's PATH.
304 tool_dirs = os.path.pathsep.join((clang_tools_dir, llvm_tools_dir))
306 # Regex assertions to reject neighbor hyphens/dots (seen in some tests).
307 # For example, don't match 'clang-check-' or '.clang-format'.
308 NoPreHyphenDot = r"(?<!(-|\.))"
309 NoPostHyphenDot = r"(?!(-|\.))"
313 r"\bc-index-test\b",
314 NoPreHyphenDot + r"\bclang-check\b" + NoPostHyphenDot,
315 NoPreHyphenDot + r"\bclang-format\b" + NoPostHyphenDot,
324 tool_patterns.append(NoPreHyphenDot + r"\bclang-interpreter\b" + NoPostHyphenDot)
329 # pattern starts with "| ", include it in the string to be
331 tool_match = re.match(r"^(\\)?((\| )?)\W+b([0-9A-Za-z-_]+)\\b\W*$",
344 # Set available features we allow tests to conditionalize on.
348 config.available_features.add("staticanalyzer")
350 # As of 2011.08, crash-recovery tests still do not pass on FreeBSD.
352 config.available_features.add('crash-recovery')
356 config.available_features.add('shell')
358 # For tests that require Darwin to run.
359 # This is used by debuginfo-tests/*block*.m and debuginfo-tests/foreach.m.
361 config.available_features.add('system-darwin')
363 # For tests that require Windows to run.
364 config.available_features.add('system-windows')
366 # ANSI escape sequences in non-dumb terminal
368 config.available_features.add('ansi-escape-sequences')
370 # Capability to print utf8 to the terminal.
373 config.available_features.add('utf8-capable-terminal')
379 config.available_features.add("native")
381 # Case-insensitive file system
383 handle, path = tempfile.mkstemp(prefix='case-test', dir=config.test_exec_root)
384 isInsensitive = os.path.exists(
385 os.path.join(
386 os.path.dirname(path),
387 os.path.basename(path).upper()
390 os.remove(path)
394 config.available_features.add('case-insensitive-filesystem')
397 if os.path.exists("/dev/fd/0") and sys.platform not in ['cygwin']:
398 config.available_features.add('dev-fd-fs')
401 if not re.match(r'.*-win32$', config.target_triple):
402 config.available_features.add('non-ms-sdk')
405 if not re.match(r'.*-scei-ps4', config.target_triple):
406 config.available_features.add('non-ps4-sdk')
408 # [PR8833] LLP64-incompatible tests
409 if not re.match(r'^x86_64.*-(win32|mingw32|windows-gnu)$', config.target_triple):
410 config.available_features.add('LP64')
412 # [PR12920] "clang-driver" -- set if gcc driver is not used.
413 if not re.match(r'.*-(cygwin)$', config.target_triple):
414 config.available_features.add('clang-driver')
416 # [PR18856] Depends to remove opened file. On win32, a file could be removed
419 config.available_features.add('can-remove-opened-file')
421 # Returns set of available features, registered-target(s) and asserts.
427 os.path.join(llvm_tools_dir, 'llvm-config'),
428 '--assertion-mode',
429 '--targets-built',
434 # 1st line corresponds to --assertion-mode, "ON" or "OFF".
437 set_of_features.add('asserts')
439 # 2nd line corresponds to --targets-built, like;
442 set_of_features.add(arch.lower() + '-registered-target')
449 config.available_features.add('xmllint')
453 config.available_features.add("asan")
455 config.available_features.add("not_asan")
457 config.available_features.add("msan")
459 config.available_features.add("ubsan")
461 config.available_features.add("not_ubsan")
464 config.available_features.add("backtrace")
467 config.available_features.add("zlib")
469 config.available_features.add("nozlib")
473 config.available_features.add("long_tests")
485 # Default to not using gmalloc
488 # Allow use of an explicit path for gmalloc library.
489 # Will default to '/usr/lib/libgmalloc.dylib' if not set.
495 # Check if we should allow outputs to console.
498 config.available_features.add('console')