[lld] r188093 - [tests] Update to use lit_config and lit package, as appropriate.
Daniel Dunbar
daniel at zuster.org
Fri Aug 9 11:51:17 PDT 2013
Author: ddunbar
Date: Fri Aug 9 13:51:17 2013
New Revision: 188093
URL: http://llvm.org/viewvc/llvm-project?rev=188093&view=rev
Log:
[tests] Update to use lit_config and lit package, as appropriate.
Modified:
lld/trunk/test/Unit/lit.cfg
lld/trunk/test/Unit/lit.site.cfg.in
lld/trunk/test/lit.cfg
lld/trunk/test/lit.site.cfg.in
Modified: lld/trunk/test/Unit/lit.cfg
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/Unit/lit.cfg?rev=188093&r1=188092&r2=188093&view=diff
==============================================================================
--- lld/trunk/test/Unit/lit.cfg (original)
+++ lld/trunk/test/Unit/lit.cfg Fri Aug 9 13:51:17 2013
@@ -4,6 +4,8 @@
import os
+import lit.formats
+
# name: The name of this test suite.
config.name = 'lld-Unit'
@@ -17,5 +19,5 @@ config.test_exec_root = config.test_sour
# testFormat: The test format to use to interpret tests.
if not hasattr(config, 'llvm_build_mode'):
- lit.fatal("unable to find llvm_build_mode value on config")
+ lit_config.fatal("unable to find llvm_build_mode value on config")
config.test_format = lit.formats.GoogleTest(config.llvm_build_mode, 'Tests')
Modified: lld/trunk/test/Unit/lit.site.cfg.in
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/Unit/lit.site.cfg.in?rev=188093&r1=188092&r2=188093&view=diff
==============================================================================
--- lld/trunk/test/Unit/lit.site.cfg.in (original)
+++ lld/trunk/test/Unit/lit.site.cfg.in Fri Aug 9 13:51:17 2013
@@ -14,12 +14,12 @@ config.python_executable = "@PYTHON_EXEC
# 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_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:
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, "@LLD_SOURCE_DIR@/test/Unit/lit.cfg")
+lit_config.load_config(config, "@LLD_SOURCE_DIR@/test/Unit/lit.cfg")
Modified: lld/trunk/test/lit.cfg
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/lit.cfg?rev=188093&r1=188092&r2=188093&view=diff
==============================================================================
--- lld/trunk/test/lit.cfg (original)
+++ lld/trunk/test/lit.cfg Fri Aug 9 13:51:17 2013
@@ -5,6 +5,8 @@ import platform
import re
import subprocess
+import lit.formats
+import lit.util
# Configuration file for the 'lit' test runner.
@@ -16,7 +18,7 @@ config.name = 'lld'
# For now we require '&&' between commands, until they get globally killed and
# the test runner updated.
execute_external = (platform.system() != 'Windows'
- or lit.getBashPath() not in [None, ""])
+ or lit_config.getBashPath() not in [None, ""])
config.test_format = lit.formats.ShTest(execute_external)
# suffixes: A list of file extensions to treat as test files.
@@ -38,7 +40,7 @@ config.llvm_obj_root = getattr(config, '
if lld_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']))
path = os.path.pathsep.join((os.path.join(getattr(config, 'llvm_src_root', None),'test','Scripts'),path))
@@ -46,7 +48,7 @@ if lld_obj_root is not None:
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
@@ -67,9 +69,9 @@ if config.test_exec_root is None:
# out-of-tree build situation).
# Check for 'lld_site_config' user parameter, and use that if available.
- site_cfg = lit.params.get('lld_site_config', None)
+ site_cfg = lit_config.params.get('lld_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
@@ -83,7 +85,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()
@@ -95,26 +97,27 @@ if config.test_exec_root is None:
# tools/lld layout.
this_src_root = os.path.dirname(config.test_source_root)
if os.path.realpath(lld_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(lld_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 lld build directory.')
+ lit_config.fatal(
+ 'No site specific configuration available! You may need to '
+ 'run "make test" in your lld build directory.')
# Okay, that worked. Notify the user of the automagic, and reconfigure.
- lit.note('using out-of-tree build at %r' % lld_obj_root)
- lit.load_config(config, site_cfg)
+ lit_config.note('using out-of-tree build at %r' % lld_obj_root)
+ lit_config.load_config(config, site_cfg)
raise SystemExit
# When running under valgrind, we mangle '-vg' onto the end of the triple so we
# can check it with XFAIL and XTARGET.
-if lit.useValgrind:
+if lit_config.useValgrind:
config.target_triple += '-vg'
# Shell execution
-if platform.system() not in ['Windows'] or lit.getBashPath() != '':
+if platform.system() not in ['Windows'] or lit_config.getBashPath() != '':
config.available_features.add('shell')
# llc knows whether it is compiled with -DNDEBUG.
Modified: lld/trunk/test/lit.site.cfg.in
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/lit.site.cfg.in?rev=188093&r1=188092&r2=188093&view=diff
==============================================================================
--- lld/trunk/test/lit.site.cfg.in (original)
+++ lld/trunk/test/lit.site.cfg.in Fri Aug 9 13:51:17 2013
@@ -12,11 +12,11 @@ config.python_executable = "@PYTHON_EXEC
# 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))
# Let the main config do the real work.
-lit.load_config(config, "@LLD_SOURCE_DIR@/test/lit.cfg")
+lit_config.load_config(config, "@LLD_SOURCE_DIR@/test/lit.cfg")
More information about the llvm-commits
mailing list