summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test
diff options
context:
space:
mode:
authorJason Molenda <jmolenda@apple.com>2018-11-01 23:41:05 +0000
committerJason Molenda <jmolenda@apple.com>2018-11-01 23:41:05 +0000
commit7d40f144f2d2f16ff2b899478e599fde674a1e37 (patch)
tree5cbd4aa5c694adecec0e563292310deaecdea4e1 /lldb/packages/Python/lldbsuite/test
parentfd9722fbc6141ebaaa4f1e7f058457e0a7d460f4 (diff)
downloadbcm5719-llvm-7d40f144f2d2f16ff2b899478e599fde674a1e37.tar.gz
bcm5719-llvm-7d40f144f2d2f16ff2b899478e599fde674a1e37.zip
When no FileCheck binary is specified, look in the llvm/clang bin
dirs relative to the source directory (Xcode build style) to find one, use it if found. llvm-svn: 345912
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test')
-rw-r--r--lldb/packages/Python/lldbsuite/test/dotest.py32
1 files changed, 32 insertions, 0 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/dotest.py b/lldb/packages/Python/lldbsuite/test/dotest.py
index e3a30ed5b10..f614fb61a35 100644
--- a/lldb/packages/Python/lldbsuite/test/dotest.py
+++ b/lldb/packages/Python/lldbsuite/test/dotest.py
@@ -313,6 +313,13 @@ def parseOptionsAndInitTestdirs():
# target. However, when invoking dotest.py directly, a valid --filecheck
# option needs to be given.
configuration.filecheck = os.path.abspath(args.filecheck)
+ else:
+ outputPaths = get_llvm_bin_dirs()
+ for outputPath in outputPaths:
+ candidatePath = os.path.join(outputPath, 'FileCheck')
+ if is_exe(candidatePath):
+ configuration.filecheck = candidatePath
+ break
if not configuration.get_filecheck_path():
logging.warning('No valid FileCheck executable; some tests may fail...')
@@ -627,6 +634,31 @@ def getOutputPaths(lldbRootDirectory):
return result
+def get_llvm_bin_dirs():
+ """
+ Returns an array of paths that may have the llvm/clang/etc binaries
+ in them, relative to this current file.
+ Returns an empty array if none are found.
+ """
+ result = []
+
+ lldb_root_path = os.path.join(
+ os.path.dirname(__file__), "..", "..", "..", "..")
+ paths_to_try = [
+ "llvm-build/Release+Asserts/x86_64/bin",
+ "llvm-build/Debug+Asserts/x86_64/bin",
+ "llvm-build/Release/x86_64/bin",
+ "llvm-build/Debug/x86_64/bin",
+ "llvm-build/Ninja-DebugAssert/llvm-macosx-x86_64/bin",
+ "llvm-build/Ninja-ReleaseAssert/llvm-macosx-x86_64/bin",
+ "llvm-build/Ninja-RelWithDebInfoAssert/llvm-macosx-x86_64/bin",
+ ]
+ for p in paths_to_try:
+ path = os.path.join(lldb_root_path, p)
+ if os.path.exists(path):
+ result.append(path)
+
+ return result
def setupSysPath():
"""
OpenPOWER on IntegriCloud