[cfe-dev] [libcxx] test/lit.cfg patch

David Fang fang at csl.cornell.edu
Tue Jan 28 15:56:09 PST 2014


Hi,

Here's another revision of the patch that doesn't call lit.util.which when 
cxx_under_test is already !None.  In either case, lit_config.note() still 
reports the value of cxx_under_test, makes sure user is running the 
intended clang++ binary.

LGTY?

David

> Hi,
> 	I discovered that when testing libc++ with cmake/lit (make 
> check-libcxx), it was choosing an installed clang++ from my $PATH over the 
> value passed in ${builddir}/test/lit.site.cfg (which is an uninstalled 
> clang++). The attached patch fixes this, and seems to match the comment in 
> context. Ok to commit?
>
> David
>
>

-- 
David Fang
http://www.csl.cornell.edu/~fang/
-------------- next part --------------
diff --git a/test/lit.cfg b/test/lit.cfg
index aa45439..6165757 100644
--- a/test/lit.cfg
+++ b/test/lit.cfg
@@ -181,10 +181,11 @@ if cxx_under_test is None:
     cxx_under_test = getattr(config, 'cxx_under_test', None)
 
     # 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_config.note("inferred cxx_under_test as: %r" % (cxx_under_test,))
+    if cxx_under_test is None:
+        clangxx = lit.util.which('clang++', config.environment['PATH'])
+        if clangxx is not None:
+            cxx_under_test = clangxx
+    lit_config.note("inferred cxx_under_test as: %r" % (cxx_under_test,))
 if cxx_under_test is None:
     lit_config.fatal('must specify user parameter cxx_under_test '
                      '(e.g., --param=cxx_under_test=clang++)')


More information about the cfe-dev mailing list