[libcxx] r174538 - [tests] Infer the cxx_under_test (as clang++).

Daniel Dunbar daniel at zuster.org
Wed Feb 6 12:24:24 PST 2013


Author: ddunbar
Date: Wed Feb  6 14:24:23 2013
New Revision: 174538

URL: http://llvm.org/viewvc/llvm-project?rev=174538&view=rev
Log:
[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.

Modified:
    libcxx/trunk/test/lit.cfg

Modified: libcxx/trunk/test/lit.cfg
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/lit.cfg?rev=174538&r1=174537&r2=174538&view=diff
==============================================================================
--- libcxx/trunk/test/lit.cfg (original)
+++ libcxx/trunk/test/lit.cfg Wed Feb  6 14:24:23 2013
@@ -209,9 +209,15 @@ config.test_source_root = os.path.dirnam
 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('t
 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





More information about the cfe-commits mailing list