Skip to content

Commit

Permalink
Simplify the CMake-generated lit.py invocation.
Browse files Browse the repository at this point in the history
Now it's down to what I use myself, plus the --xunit-xml-output flag.
I also threw out a fair number of options we weren't using.

Swift SVN r31646
  • Loading branch information
jrose-apple committed Sep 3, 2015
1 parent df3dd45 commit 99febda
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 52 deletions.
18 changes: 1 addition & 17 deletions test/Unit/lit.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,7 @@ if swift_obj_root is not None:
config.test_source_root = config.test_exec_root

# testFormat: The test format to use to interpret tests.
llvm_build_mode = getattr(config, 'llvm_build_mode', "Debug")
config.test_format = lit.formats.GoogleTest(llvm_build_mode, 'Tests')

# Propagate the temp directory. Windows requires this because it uses \Windows\
# if none of these are present.
if 'TMP' in os.environ:
config.environment['TMP'] = os.environ['TMP']
if 'TEMP' in os.environ:
config.environment['TEMP'] = os.environ['TEMP']
config.test_format = lit.formats.GoogleTest(config.build_mode, 'Tests')

###

Expand Down Expand Up @@ -79,11 +71,3 @@ if config.test_exec_root is None:
lit_config.note('using out-of-tree build at %r' % swift_obj_root)
lit_config.load_config(config, site_cfg)
raise SystemExit

# If necessary, point the dynamic loader at libLLVM.so.
if config.enable_shared:
shlibpath = config.environment.get(config.shlibpath_var,'')
if shlibpath:
shlibpath = os.pathsep + shlibpath
shlibpath = config.shlibdir + shlibpath
config.environment[config.shlibpath_var] = shlibpath
16 changes: 1 addition & 15 deletions test/Unit/lit.site.cfg.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,9 @@ config.llvm_src_root = "@LLVM_SOURCE_DIR@"
config.llvm_obj_root = "@LLVM_BINARY_DIR@"
config.llvm_tools_dir = "@LLVM_TOOLS_DIR@"
config.llvm_libs_dir = "@LLVM_LIBS_DIR@"
config.llvm_build_mode = "@LLVM_BUILD_MODE@"
config.build_mode = lit_config.params.get('build_mode', "@LLVM_BUILD_MODE@")
config.swift_obj_root = "@SWIFT_BINARY_DIR@"
config.enable_shared = @ENABLE_SHARED@
config.shlibdir = "@SHLIBDIR@"
config.shlibpath_var = "@SHLIBPATH_VAR@"
config.target_triple = "@TARGET_TRIPLE@"

# Support substitution of the tools_dir, libs_dirs, and build_mode 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_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_config.fatal("unable to find %r parameter, use '--param=%s=VALUE'" % (key,key))

# Let the main config do the real work.
lit_config.load_config(config, "@SWIFT_SOURCE_DIR@/test/Unit/lit.cfg")
10 changes: 0 additions & 10 deletions test/lit.site.cfg.in
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,6 @@ config.targets_to_build = "@TARGETS_TO_BUILD@"
config.variant_triple = "@VARIANT_TRIPLE@"
config.variant_sdk = "@VARIANT_SDK@"

# 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_config.params
config.llvm_libs_dir = config.llvm_libs_dir % lit_config.params
except KeyError:
e = sys.exc_info()[1]
key, = e.args
lit_config.fatal("unable to find %r parameter, use '--param=%s=VALUE'" % (key,key))

if "@SWIFT_ASAN_BUILD@" == "TRUE":
config.available_features.add("asan")
else:
Expand Down
10 changes: 0 additions & 10 deletions validation-test/lit.site.cfg.in
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,6 @@ config.targets_to_build = "@TARGETS_TO_BUILD@"
config.variant_triple = "@VARIANT_TRIPLE@"
config.variant_sdk = "@VARIANT_SDK@"

# 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_config.params
config.llvm_libs_dir = config.llvm_libs_dir % lit_config.params
except KeyError:
e = sys.exc_info()[1]
key, = e.args
lit_config.fatal("unable to find %r parameter, use '--param=%s=VALUE'" % (key,key))

if "@SWIFT_ASAN_BUILD@" == "TRUE":
config.available_features.add("asan")

Expand Down

0 comments on commit 99febda

Please sign in to comment.