[tests] Update to use lit_config and lit package, as appropriate.
llvm-svn: 188114
This commit is contained in:
parent
ae66d57bcf
commit
2bd59a2cc7
|
@ -4,6 +4,9 @@ import os
|
|||
import platform
|
||||
import re
|
||||
|
||||
import lit.formats
|
||||
import lit.util
|
||||
|
||||
# Configuration file for the 'lit' test runner.
|
||||
|
||||
# name: The name of this test suite.
|
||||
|
@ -35,13 +38,13 @@ config.llvm_obj_root = getattr(config, 'llvm_obj_root', None)
|
|||
if polly_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
|
||||
|
@ -56,9 +59,9 @@ if config.test_exec_root is None:
|
|||
# out-of-tree build situation).
|
||||
|
||||
# Check for 'polly_site_config' user parameter, and use that if available.
|
||||
site_cfg = lit.params.get('polly_site_config', None)
|
||||
site_cfg = lit_config.params.get('polly_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
|
||||
|
@ -72,7 +75,7 @@ if config.test_exec_root is None:
|
|||
|
||||
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()
|
||||
|
@ -84,16 +87,16 @@ if config.test_exec_root is None:
|
|||
# tools/polly layout.
|
||||
this_src_root = os.path.dirname(config.test_source_root)
|
||||
if os.path.realpath(polly_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(polly_obj_root, 'test', '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' % polly_obj_root)
|
||||
lit.load_config(config, site_cfg)
|
||||
lit_config.note('using out-of-tree build at %r' % polly_obj_root)
|
||||
lit_config.load_config(config, site_cfg)
|
||||
raise SystemExit
|
||||
|
||||
# llc knows whether he is compiled with -DNDEBUG.
|
||||
|
|
|
@ -19,11 +19,11 @@ if (re.match(r'^x86_64*', '@TARGET_TRIPLE@') == None) :
|
|||
# Support substitution of the tools and libs dirs with user parameters. This is
|
||||
# used when we can't determine the tool dir at configuration time.
|
||||
try:
|
||||
config.llvm_tools_dir = config.llvm_tools_dir % lit.params
|
||||
config.llvm_libs_dir = config.llvm_libs_dir % lit.params
|
||||
config.llvm_tools_dir = config.llvm_tools_dir % lit_config.params
|
||||
config.llvm_libs_dir = config.llvm_libs_dir % lit_config.params
|
||||
except KeyError,e:
|
||||
key, = e.args
|
||||
lit.fatal("unable to find %r parameter, use '--param=%s=VALUE'" % (key,key))
|
||||
lit_config.fatal("unable to find %r parameter, use '--param=%s=VALUE'" % (key,key))
|
||||
|
||||
config.substitutions.append(('%loadPolly', '-load '
|
||||
+ config.polly_lib_dir + '/LLVMPolly@LLVM_SHLIBEXT@'))
|
||||
|
@ -32,4 +32,4 @@ config.substitutions.append(('%polybenchOpts', ' -O3 -loop-simplify -indvars '))
|
|||
config.substitutions.append(('%vector-opt', '-polly-vectorizer=polly'))
|
||||
|
||||
# Let the main config do the real work.
|
||||
lit.load_config(config, "@POLLY_SOURCE_DIR@/test/lit.cfg")
|
||||
lit_config.load_config(config, "@POLLY_SOURCE_DIR@/test/lit.cfg")
|
||||
|
|
Loading…
Reference in New Issue