[Lldb-commits] [lldb] r152367 - /lldb/trunk/test/dotest.py
Johnny Chen
johnny.chen at apple.com
Thu Mar 8 18:11:38 PST 2012
Author: johnny
Date: Thu Mar 8 20:11:37 2012
New Revision: 152367
URL: http://llvm.org/viewvc/llvm-project?rev=152367&view=rev
Log:
Add the capability on OS X to utilize 'xcrun' to locate the compilers used for building the inferior programs
to be debugged while running the test suite. By default, compilers is set to ['clang'] and can be overridden
using the "-C compilerA^compilerB" option.
Modified:
lldb/trunk/test/dotest.py
Modified: lldb/trunk/test/dotest.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/dotest.py?rev=152367&r1=152366&r2=152367&view=diff
==============================================================================
--- lldb/trunk/test/dotest.py (original)
+++ lldb/trunk/test/dotest.py Thu Mar 8 20:11:37 2012
@@ -95,7 +95,7 @@
# of the list type. For example, "-A x86_64^i386" => archs=['x86_64', 'i386'] and
# "-C gcc^clang" => compilers=['gcc', 'clang'].
archs = ['x86_64', 'i386']
-compilers = None
+compilers = ['clang']
# Delay startup in order for the debugger to attach.
delay = False
@@ -1048,6 +1048,31 @@
if not compilers and "compilers" in config:
compilers = config["compilers"]
+#
+# Add some intervention here to sanity check that the compilers requested are sane.
+# If found not to be an executable program, the invalid one is dropped from the list.
+for i in range(len(compilers)):
+ c = compilers[i]
+ if which(c):
+ continue
+ else:
+ if sys.platform.startswith("darwin"):
+ pipe = subprocess.Popen(['xcrun', '-find', c], stdout = subprocess.PIPE, stderr = subprocess.STDOUT)
+ cmd_output = pipe.stdout.read()
+ if cmd_output:
+ if "not found" in cmd_output:
+ print "dropping %s from the compilers used" % c
+ compilers.remove(i)
+ else:
+ compilers[i] = cmd_output.split('\n')[0]
+ print "'xcrun -find %s' returning %s" % (c, compilers[i])
+
+print "compilers=%s" % str(compilers)
+
+if not compilers or len(compilers) == 0:
+ print "No eligible compiler found, exiting."
+ sys.exit(1)
+
if isinstance(compilers, list) and len(compilers) >= 1:
iterCompilers = True
More information about the lldb-commits
mailing list