From 05abe9372bfe9213f4f511ea351ab9e6b7f000bc Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Wed, 6 Feb 2013 20:24:23 +0000 Subject: [PATCH] [tests] Infer the cxx_under_test (as clang++). - This is a reasonable default, and makes testing just work with no required parameters. - Add notes on all of the inferred or default values. llvm-svn: 174538 --- libcxx/test/lit.cfg | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/libcxx/test/lit.cfg b/libcxx/test/lit.cfg index 4b91708..7d8e518 100644 --- a/libcxx/test/lit.cfg +++ b/libcxx/test/lit.cfg @@ -209,9 +209,15 @@ config.test_source_root = os.path.dirname(__file__) cxx_under_test = lit.params.get('cxx_under_test', None) if cxx_under_test is None: cxx_under_test = getattr(config, 'cxx_under_test', None) - if cxx_under_test is None: - lit.fatal('must specify user parameter cxx_under_test ' - '(e.g., --param=cxx_under_test=clang++)') + + # If no specific cxx_under_test was given, attempt to infer it as clang++. + clangxx = lit.util.which('clang++', config.environment['PATH']) + if clangxx is not None: + cxx_under_test = clangxx + lit.note("inferred cxx_under_test as: %r" % (cxx_under_test,)) +if cxx_under_test is None: + lit.fatal('must specify user parameter cxx_under_test ' + '(e.g., --param=cxx_under_test=clang++)') libcxx_src_root = lit.params.get('libcxx_src_root', None) if libcxx_src_root is None: @@ -250,6 +256,7 @@ if use_system_lib_str is not None: else: # Default to testing against the locally built libc++ library. use_system_lib = False + lit.note("inferred use_system_lib as: %r" % (use_system_lib,)) # Configure extra compiler flags. include_paths = ['-I' + libcxx_src_root + '/include', '-I' + libcxx_src_root + '/test/support'] @@ -284,7 +291,7 @@ config.target_triple = lit.params.get('target_triple', None) if config.target_triple is None: config.target_triple = lit.util.capture( [cxx_under_test, '-dumpmachine']).strip() - lit.note("inferred target triple as: %r" % (config.target_triple,)) + lit.note("inferred target_triple as: %r" % (config.target_triple,)) # Write an "available feature" that combines the triple when use_system_lib is # enabled. This is so that we can easily write XFAIL markers for tests that are -- 2.7.4