[llvm-commits] [zorg] r152850 - in /zorg/trunk/lnt/lnt/tests: compile.py nt.py

Daniel Dunbar daniel at zuster.org
Thu Mar 15 14:41:28 PDT 2012


Author: ddunbar
Date: Thu Mar 15 16:41:28 2012
New Revision: 152850

URL: http://llvm.org/viewvc/llvm-project?rev=152850&view=rev
Log:
[LNT] lnt.tests.{compile,nt}: Use the just added infer function, this means
users can generally avoid passing --cxx explicitly.

Modified:
    zorg/trunk/lnt/lnt/tests/compile.py
    zorg/trunk/lnt/lnt/tests/nt.py

Modified: zorg/trunk/lnt/lnt/tests/compile.py
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/lnt/lnt/tests/compile.py?rev=152850&r1=152849&r2=152850&view=diff
==============================================================================
--- zorg/trunk/lnt/lnt/tests/compile.py (original)
+++ zorg/trunk/lnt/lnt/tests/compile.py Thu Mar 15 16:41:28 2012
@@ -583,14 +583,9 @@
 
         # Attempt to infer the cxx compiler if not given.
         if opts.cc and opts.cxx is None:
-            name = os.path.basename(opts.cc)
-            cxx_name = { 'clang' : 'clang++',
-                         'gcc' : 'g++',
-                         'llvm-gcc' : 'llvm-g++' }.get(name)
-            if cxx_name is not None:
-                opts.cxx = os.path.join(os.path.dirname(opts.cc),
-                                        cxx_name)
-                note("inferred C++ compiler: %r" % (opts.cxx,))
+            opts.cxx = lnt.testing.util.compilers.infer_cxx_compiler(opts.cc)
+            if opts.cxx is not None
+                note("inferred C++ compiler under test as: %r" % (opts.cxx,))
 
         # Validate options.
         if opts.cc is None:

Modified: zorg/trunk/lnt/lnt/tests/nt.py
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/lnt/lnt/tests/nt.py?rev=152850&r1=152849&r2=152850&view=diff
==============================================================================
--- zorg/trunk/lnt/lnt/tests/nt.py (original)
+++ zorg/trunk/lnt/lnt/tests/nt.py Thu Mar 15 16:41:28 2012
@@ -1095,6 +1095,16 @@
 
         if opts.cc_under_test is None:
             parser.error('--cc is required')
+
+        # If there was no --cxx given, attempt to infer it from the --cc.
+        if opts.cxx_under_test is None:
+            opts.cxx_under_test = lnt.testing.util.compilers.infer_cxx_compiler(
+                opts.cc_under_test)
+            if opts.cxx_under_test is not None:
+                note("inferred C++ compiler under test as: %r" % (
+                    opts.cxx_under_test,))
+
+        # The cxx_under_test option is required if we are testing C++.
         if opts.test_cxx and opts.cxx_under_test is None:
             parser.error('--cxx is required')
 





More information about the llvm-commits mailing list