diff options
author | Daniel Dunbar <daniel@zuster.org> | 2013-08-09 14:43:04 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2013-08-09 14:43:04 +0000 |
commit | 4c87ca4d179086967a81e695778a4b434188b6e6 (patch) | |
tree | 2c126f1499b14b891ee0e09b373cf0156e665834 /test/Unit | |
parent | 48d0f0788998f10b769696910799255430f2a3d8 (diff) |
[tests] Update to use lit_config and lit package, as appropriate.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188072 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Unit')
-rw-r--r-- | test/Unit/lit.cfg | 17 | ||||
-rw-r--r-- | test/Unit/lit.site.cfg.in | 10 |
2 files changed, 15 insertions, 12 deletions
diff --git a/test/Unit/lit.cfg b/test/Unit/lit.cfg index d58337c8f7..f39fded3ac 100644 --- a/test/Unit/lit.cfg +++ b/test/Unit/lit.cfg @@ -4,6 +4,9 @@ import os +import lit.formats +import lit.util + # name: The name of this test suite. config.name = 'Clang-Unit' @@ -43,9 +46,9 @@ if config.test_exec_root is None: # 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 @@ -58,7 +61,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() @@ -70,16 +73,16 @@ if config.test_exec_root is None: # 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. diff --git a/test/Unit/lit.site.cfg.in b/test/Unit/lit.site.cfg.in index 9765f08a8e..a255cdce0d 100644 --- a/test/Unit/lit.site.cfg.in +++ b/test/Unit/lit.site.cfg.in @@ -17,13 +17,13 @@ config.target_triple = "@TARGET_TRIPLE@" # 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_build_mode = config.llvm_build_mode % lit.params + config.llvm_tools_dir = config.llvm_tools_dir % lit_config.params + config.llvm_libs_dir = config.llvm_libs_dir % lit_config.params + config.llvm_build_mode = config.llvm_build_mode % lit_config.params except KeyError: e = sys.exc_info()[1] 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)) # Let the main config do the real work. -lit.load_config(config, "@CLANG_SOURCE_DIR@/test/Unit/lit.cfg") +lit_config.load_config(config, "@CLANG_SOURCE_DIR@/test/Unit/lit.cfg") |