summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephane Sezer <sas@cd80.net>2015-01-09 21:54:27 +0000
committerStephane Sezer <sas@cd80.net>2015-01-09 21:54:27 +0000
commit2ff8b5687b988fd41179e035340b84133d9651e6 (patch)
tree10dd0567ee0ae48f410e15fcf6c4cafa4e9e02d5
parentb0893dbb5c4d868f673fbe0f6f2adbdd28627045 (diff)
Modify dotest.py to be able to run without an lldb build.
Summary: This will ease llgs development a bit by not requiring an lldb/lldb.py build to launch the tests. Also, we can now use LLDB_DEBUGSERVER_PATH to point to a debug server to use to run the tests. I used that to point to a ds2 build and run llgs tests against ds2. Reviewers: clayborg, tfiala, vharron Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D6554 git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@225549 91177308-0d34-0410-b5e6-96231b3b80d8
-rwxr-xr-xtest/dotest.py33
-rw-r--r--test/tools/lldb-gdbserver/lldbgdbserverutils.py26
2 files changed, 34 insertions, 25 deletions
diff --git a/test/dotest.py b/test/dotest.py
index 5c2401ae5..d6f9fd30d 100755
--- a/test/dotest.py
+++ b/test/dotest.py
@@ -949,13 +949,13 @@ def setupSysPath():
lldbExec = None
lldbMiExec = None
+ lldbHere = None
if lldbExecutablePath:
if is_exe(lldbExecutablePath):
lldbExec = lldbExecutablePath
lldbHere = lldbExec
else:
- print lldbExecutablePath + " is not an executable"
- sys.exit(-1)
+ print lldbExecutablePath + " is not an executable, lldb tests will fail."
else:
# First, you can define an environment variable LLDB_EXEC specifying the
# full pathname of the lldb executable.
@@ -975,7 +975,6 @@ def setupSysPath():
baiExec2 = os.path.join(base, *(xcode4_build_dir + bai + executable))
# The 'lldb' executable built here in the source tree.
- lldbHere = None
if is_exe(dbgExec):
lldbHere = dbgExec
elif is_exe(dbgExec2):
@@ -1102,24 +1101,24 @@ def setupSysPath():
if not lldbPath:
print 'This script requires lldb.py to be in either ' + dbgPath + ',',
- print relPath + ', or ' + baiPath
- sys.exit(-1)
+ print relPath + ', or ' + baiPath + '. Some tests might fail.'
- # Some of the code that uses this path assumes it hasn't resolved the Versions... link.
- # If the path we've constructed looks like that, then we'll strip out the Versions/A part.
- (before, frameWithVersion, after) = lldbPath.rpartition("LLDB.framework/Versions/A")
- if frameWithVersion != "" :
- lldbPath = before + "LLDB.framework" + after
+ if lldbPath:
+ # Some of the code that uses this path assumes it hasn't resolved the Versions... link.
+ # If the path we've constructed looks like that, then we'll strip out the Versions/A part.
+ (before, frameWithVersion, after) = lldbPath.rpartition("LLDB.framework/Versions/A")
+ if frameWithVersion != "" :
+ lldbPath = before + "LLDB.framework" + after
- lldbPath = os.path.abspath(lldbPath)
+ lldbPath = os.path.abspath(lldbPath)
- # If tests need to find LLDB_FRAMEWORK, now they can do it
- os.environ["LLDB_FRAMEWORK"] = os.path.dirname(os.path.dirname(lldbPath))
+ # If tests need to find LLDB_FRAMEWORK, now they can do it
+ os.environ["LLDB_FRAMEWORK"] = os.path.dirname(os.path.dirname(lldbPath))
- # This is to locate the lldb.py module. Insert it right after sys.path[0].
- sys.path[1:1] = [lldbPath]
- if dumpSysPath:
- print "sys.path:", sys.path
+ # This is to locate the lldb.py module. Insert it right after sys.path[0].
+ sys.path[1:1] = [lldbPath]
+ if dumpSysPath:
+ print "sys.path:", sys.path
def visit(prefix, dir, names):
"""Visitor function for os.path.walk(path, visit, arg)."""
diff --git a/test/tools/lldb-gdbserver/lldbgdbserverutils.py b/test/tools/lldb-gdbserver/lldbgdbserverutils.py
index 7ba04267a..c69a360d0 100644
--- a/test/tools/lldb-gdbserver/lldbgdbserverutils.py
+++ b/test/tools/lldb-gdbserver/lldbgdbserverutils.py
@@ -56,11 +56,16 @@ def get_lldb_gdbserver_exe():
A path to the lldb-gdbserver exe if it is found to exist; otherwise,
returns None.
"""
- lldb_exe = os.environ["LLDB_EXEC"]
- if not lldb_exe:
- return None
+ if "LLDB_DEBUGSERVER_PATH" in os.environ:
+ return os.environ["LLDB_DEBUGSERVER_PATH"]
+ elif "LLDB_EXEC" in os.environ:
+ lldb_exe = os.environ["LLDB_EXEC"]
+ if not lldb_exe:
+ return None
+ else:
+ return _get_debug_monitor_from_lldb(lldb_exe, "lldb-gdbserver")
else:
- return _get_debug_monitor_from_lldb(lldb_exe, "lldb-gdbserver")
+ return None
def get_debugserver_exe():
"""Return the debugserver exe path.
@@ -69,11 +74,16 @@ def get_debugserver_exe():
A path to the debugserver exe if it is found to exist; otherwise,
returns None.
"""
- lldb_exe = os.environ["LLDB_EXEC"]
- if not lldb_exe:
- return None
+ if "LLDB_DEBUGSERVER_PATH" in os.environ:
+ return os.environ["LLDB_DEBUGSERVER_PATH"]
+ elif "LLDB_EXEC" in os.environ:
+ lldb_exe = os.environ["LLDB_EXEC"]
+ if not lldb_exe:
+ return None
+ else:
+ return _get_debug_monitor_from_lldb(lldb_exe, "debugserver")
else:
- return _get_debug_monitor_from_lldb(lldb_exe, "debugserver")
+ return None
_LOG_LINE_REGEX = re.compile(r'^(lldb-gdbserver|debugserver)\s+<\s*(\d+)>' +