import os
+import lit.formats
+import lit.util
+
# name: The name of this test suite.
config.name = 'Clang-Unit'
# out-of-tree build situation).
# Check for 'clang_unit_site_config' user parameter, and use that if available.
- site_cfg = lit.params.get('clang_unit_site_config', None)
+ site_cfg = lit_config.params.get('clang_unit_site_config', None)
if site_cfg and os.path.exists(site_cfg):
- lit.load_config(config, site_cfg)
+ lit_config.load_config(config, site_cfg)
raise SystemExit
# Try to detect the situation where we are using an out-of-tree build by
llvm_config = lit.util.which('llvm-config', config.environment['PATH'])
if not llvm_config:
- lit.fatal('No site specific configuration available!')
+ lit_config.fatal('No site specific configuration available!')
# Get the source and object roots.
llvm_src_root = lit.util.capture(['llvm-config', '--src-root']).strip()
# tools/clang layout.
this_src_root = os.path.join(os.path.dirname(__file__),'..','..')
if os.path.realpath(clang_src_root) != os.path.realpath(this_src_root):
- lit.fatal('No site specific configuration available!')
+ lit_config.fatal('No site specific configuration available!')
# Check that the site specific configuration exists.
site_cfg = os.path.join(clang_obj_root, 'test', 'Unit', 'lit.site.cfg')
if not os.path.exists(site_cfg):
- lit.fatal('No site specific configuration available!')
+ lit_config.fatal('No site specific configuration available!')
# Okay, that worked. Notify the user of the automagic, and reconfigure.
- lit.note('using out-of-tree build at %r' % clang_obj_root)
- lit.load_config(config, site_cfg)
+ lit_config.note('using out-of-tree build at %r' % clang_obj_root)
+ lit_config.load_config(config, site_cfg)
raise SystemExit
# If necessary, point the dynamic loader at libLLVM.so.
import subprocess
import tempfile
+import lit.formats
+import lit.util
# Configuration file for the 'lit' test runner.
if platform.system() == 'Windows':
# Seek sane tools in directories and set to $PATH.
path = getattr(config, 'lit_tools_dir', None)
- path = lit.getToolsPath(path,
- config.environment['PATH'],
- ['cmp.exe', 'grep.exe', 'sed.exe'])
+ path = lit_config.getToolsPath(path,
+ config.environment['PATH'],
+ ['cmp.exe', 'grep.exe', 'sed.exe'])
if path is not None:
path = os.path.pathsep.join((path,
config.environment['PATH']))
if clang_obj_root is not None:
llvm_tools_dir = getattr(config, 'llvm_tools_dir', None)
if not llvm_tools_dir:
- lit.fatal('No LLVM tools dir set!')
+ lit_config.fatal('No LLVM tools dir set!')
path = os.path.pathsep.join((llvm_tools_dir, config.environment['PATH']))
config.environment['PATH'] = path
llvm_libs_dir = getattr(config, 'llvm_libs_dir', None)
if not llvm_libs_dir:
- lit.fatal('No LLVM libs dir set!')
+ lit_config.fatal('No LLVM libs dir set!')
path = os.path.pathsep.join((llvm_libs_dir,
config.environment.get('LD_LIBRARY_PATH','')))
config.environment['LD_LIBRARY_PATH'] = path
# out-of-tree build situation).
# Check for 'clang_site_config' user parameter, and use that if available.
- site_cfg = lit.params.get('clang_site_config', None)
+ site_cfg = lit_config.params.get('clang_site_config', None)
if site_cfg and os.path.exists(site_cfg):
- lit.load_config(config, site_cfg)
+ lit_config.load_config(config, site_cfg)
raise SystemExit
# Try to detect the situation where we are using an out-of-tree build by
llvm_config = lit.util.which('llvm-config', config.environment['PATH'])
if not llvm_config:
- lit.fatal('No site specific configuration available!')
+ lit_config.fatal('No site specific configuration available!')
# Get the source and object roots.
llvm_src_root = lit.util.capture(['llvm-config', '--src-root']).strip()
# tools/clang layout.
this_src_root = os.path.dirname(config.test_source_root)
if os.path.realpath(clang_src_root) != os.path.realpath(this_src_root):
- lit.fatal('No site specific configuration available!')
+ lit_config.fatal('No site specific configuration available!')
# Check that the site specific configuration exists.
site_cfg = os.path.join(clang_obj_root, 'test', 'lit.site.cfg')
if not os.path.exists(site_cfg):
- lit.fatal('No site specific configuration available! You may need to '
- 'run "make test" in your Clang build directory.')
+ lit_config.fatal(
+ 'No site specific configuration available! You may need to '
+ 'run "make test" in your Clang build directory.')
# Okay, that worked. Notify the user of the automagic, and reconfigure.
- lit.note('using out-of-tree build at %r' % clang_obj_root)
- lit.load_config(config, site_cfg)
+ lit_config.note('using out-of-tree build at %r' % clang_obj_root)
+ lit_config.load_config(config, site_cfg)
raise SystemExit
###
clang = lit.util.which('clang', PATH)
if not clang:
- lit.fatal("couldn't find 'clang' program, try setting "
- "CLANG in your environment")
+ lit_config.fatal("couldn't find 'clang' program, try setting "
+ "CLANG in your environment")
return clang
config.clang = inferClang(config.environment['PATH']).replace('\\', '/')
-if not lit.quiet:
- lit.note('using clang: %r' % config.clang)
+if not lit_config.quiet:
+ lit_config.note('using clang: %r' % config.clang)
# Note that when substituting %clang_cc1 also fill in the include directory of
# the builtin headers. Those are part of even a freestanding environment, but
cmd = subprocess.Popen([clang, '-print-file-name=include'],
stdout=subprocess.PIPE)
if not cmd.stdout:
- lit.fatal("Couldn't find the include dir for Clang ('%s')" % clang)
+ lit_config.fatal("Couldn't find the include dir for Clang ('%s')" % clang)
dir = cmd.stdout.read().strip()
if sys.platform in ['win32'] and execute_external:
# Don't pass dosish path separator to msys bash.exe.
if len(llc_props['set_of_targets']) > 0:
config.available_features.update(llc_props['set_of_targets'])
else:
- lit.fatal('No Targets Registered with the LLVM Tools!')
+ lit_config.fatal('No Targets Registered with the LLVM Tools!')
if llc_props['enable_assertions']:
config.available_features.add('asserts')
config.available_features.add("msan")
# Check if we should run long running tests.
-if lit.params.get("run_long_tests", None) == "true":
+if lit_config.params.get("run_long_tests", None) == "true":
config.available_features.add("long_tests")
# Check if we should use gmalloc.
-use_gmalloc_str = lit.params.get('use_gmalloc', None)
+use_gmalloc_str = lit_config.params.get('use_gmalloc', None)
if use_gmalloc_str is not None:
if use_gmalloc_str.lower() in ('1', 'true'):
use_gmalloc = True
elif use_gmalloc_str.lower() in ('', '0', 'false'):
use_gmalloc = False
else:
- lit.fatal('user parameter use_gmalloc should be 0 or 1')
+ lit_config.fatal('user parameter use_gmalloc should be 0 or 1')
else:
# Default to not using gmalloc
use_gmalloc = False
# Allow use of an explicit path for gmalloc library.
# Will default to '/usr/lib/libgmalloc.dylib' if not set.
-gmalloc_path_str = lit.params.get('gmalloc_path', '/usr/lib/libgmalloc.dylib')
+gmalloc_path_str = lit_config.params.get('gmalloc_path',
+ '/usr/lib/libgmalloc.dylib')
if use_gmalloc:
config.environment.update({'DYLD_INSERT_LIBRARIES' : gmalloc_path_str})