diff options
author | Ilia K <ki.stfu@gmail.com> | 2015-03-12 07:32:32 +0000 |
---|---|---|
committer | Ilia K <ki.stfu@gmail.com> | 2015-03-12 07:32:32 +0000 |
commit | ba6d7b6004df3eb2fbb8c1f6d1f20fe583f2e4ff (patch) | |
tree | 5ca9ba88db069fdff0b9b7bdd8e38ab09dd0c5a3 | |
parent | 5d06b4c80cae521dda5f0fe7027f892155e68e50 (diff) | |
download | bcm5719-llvm-ba6d7b6004df3eb2fbb8c1f6d1f20fe583f2e4ff.tar.gz bcm5719-llvm-ba6d7b6004df3eb2fbb8c1f6d1f20fe583f2e4ff.zip |
Add lldb-mi/lldb-server test folders to PATH before in dotest.py
Summary:
This patch allows not specify search path in each lldb-mi test. It makes tests easier.
This fix was requested by vharron.
All test pass on OS X.
Reviewers: vharron, clayborg
Subscribers: lldb-commits, vharron
Differential Revision: http://reviews.llvm.org/D8207
llvm-svn: 232019
16 files changed, 7 insertions, 71 deletions
diff --git a/lldb/test/dotest.py b/lldb/test/dotest.py index 761aee0d5e5..43461ed0ecf 100755 --- a/lldb/test/dotest.py +++ b/lldb/test/dotest.py @@ -932,14 +932,20 @@ def setupSysPath(): pluginPath = os.path.join(scriptPath, 'plugins') pexpectPath = os.path.join(scriptPath, 'pexpect-2.4') + toolsLLDBMIPath = os.path.join(scriptPath, 'tools', 'lldb-mi') + toolsLLDBServerPath = os.path.join(scriptPath, 'tools', 'lldb-server') # Put embedded pexpect at front of the load path so we ensure we # use that version. sys.path.insert(0, pexpectPath) - # Append script dir and plugin dir to the sys.path. + # Append script dir, plugin dir, lldb-mi dir and lldb-server dir to the sys.path. sys.path.append(scriptPath) sys.path.append(pluginPath) + sys.path.append(toolsLLDBMIPath) # Adding test/tools/lldb-mi to the path makes it easy + # to "import lldbmi_testcase" from the MI tests + sys.path.append(toolsLLDBServerPath) # Adding test/tools/lldb-server to the path makes it easy + # to "import lldbgdbserverutils" from the lldb-server tests # This is our base name component. base = os.path.abspath(os.path.join(scriptPath, os.pardir)) diff --git a/lldb/test/tools/lldb-mi/breakpoint/TestMiBreak.py b/lldb/test/tools/lldb-mi/breakpoint/TestMiBreak.py index ca205611fd2..c1e4e9e5945 100644 --- a/lldb/test/tools/lldb-mi/breakpoint/TestMiBreak.py +++ b/lldb/test/tools/lldb-mi/breakpoint/TestMiBreak.py @@ -2,10 +2,6 @@ Test lldb-mi -break-xxx commands. """ -# adjust path for lldbmi_testcase.py -import sys, os.path -sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) - import lldbmi_testcase from lldbtest import * import unittest2 diff --git a/lldb/test/tools/lldb-mi/control/TestMiExec.py b/lldb/test/tools/lldb-mi/control/TestMiExec.py index de7918ad606..7145aadda0a 100644 --- a/lldb/test/tools/lldb-mi/control/TestMiExec.py +++ b/lldb/test/tools/lldb-mi/control/TestMiExec.py @@ -2,10 +2,6 @@ Test lldb-mi -exec-xxx commands. """ -# adjust path for lldbmi_testcase.py -import sys, os.path -sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) - import lldbmi_testcase from lldbtest import * import unittest2 diff --git a/lldb/test/tools/lldb-mi/data/TestMiData.py b/lldb/test/tools/lldb-mi/data/TestMiData.py index 4113e5070d2..ac50e25a9dd 100644 --- a/lldb/test/tools/lldb-mi/data/TestMiData.py +++ b/lldb/test/tools/lldb-mi/data/TestMiData.py @@ -2,10 +2,6 @@ Test lldb-mi -data-xxx commands. """ -# adjust path for lldbmi_testcase.py -import sys, os.path -sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) - import lldbmi_testcase from lldbtest import * import unittest2 diff --git a/lldb/test/tools/lldb-mi/interpreter/TestMiInterpreterExec.py b/lldb/test/tools/lldb-mi/interpreter/TestMiInterpreterExec.py index bd58cf4bfff..06d057cd4a6 100644 --- a/lldb/test/tools/lldb-mi/interpreter/TestMiInterpreterExec.py +++ b/lldb/test/tools/lldb-mi/interpreter/TestMiInterpreterExec.py @@ -2,10 +2,6 @@ Test lldb-mi -interpreter-exec command. """ -# adjust path for lldbmi_testcase.py -import sys, os.path -sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) - import lldbmi_testcase from lldbtest import * import unittest2 diff --git a/lldb/test/tools/lldb-mi/signal/TestMiSignal.py b/lldb/test/tools/lldb-mi/signal/TestMiSignal.py index e4d29dff7e3..3810234e9b3 100644 --- a/lldb/test/tools/lldb-mi/signal/TestMiSignal.py +++ b/lldb/test/tools/lldb-mi/signal/TestMiSignal.py @@ -2,10 +2,6 @@ Test that the lldb-mi handles signals properly. """ -# adjust path for lldbmi_testcase.py -import sys, os.path -sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) - import lldbmi_testcase from lldbtest import * import unittest2 @@ -90,7 +86,6 @@ class MiSignalTestCase(lldbmi_testcase.MiTestCaseBase): """Test that 'lldb-mi --interpreter' notifies after it was stopped on entry (remote).""" # Prepare debugserver - sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..", "lldb-server"))) import lldbgdbserverutils debugserver_exe = lldbgdbserverutils.get_debugserver_exe() if not debugserver_exe: @@ -167,7 +162,6 @@ class MiSignalTestCase(lldbmi_testcase.MiTestCaseBase): """Test that 'lldb-mi --interpreter' notifies after it was stopped when segfault occurred (remote).""" # Prepare debugserver - sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..", "lldb-server"))) import lldbgdbserverutils debugserver_exe = lldbgdbserverutils.get_debugserver_exe() if not debugserver_exe: diff --git a/lldb/test/tools/lldb-mi/stack/TestMiStack.py b/lldb/test/tools/lldb-mi/stack/TestMiStack.py index b289d84a094..5dc5bd46109 100644 --- a/lldb/test/tools/lldb-mi/stack/TestMiStack.py +++ b/lldb/test/tools/lldb-mi/stack/TestMiStack.py @@ -2,10 +2,6 @@ Test lldb-mi -stack-xxx commands. """ -# adjust path for lldbmi_testcase.py -import sys, os.path -sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) - import lldbmi_testcase from lldbtest import * import unittest2 diff --git a/lldb/test/tools/lldb-mi/startup_options/TestMiStartupOptions.py b/lldb/test/tools/lldb-mi/startup_options/TestMiStartupOptions.py index 077bdbf25fe..a4d8fed3e88 100644 --- a/lldb/test/tools/lldb-mi/startup_options/TestMiStartupOptions.py +++ b/lldb/test/tools/lldb-mi/startup_options/TestMiStartupOptions.py @@ -2,10 +2,6 @@ Test lldb-mi startup options. """ -# adjust path for lldbmi_testcase.py -import sys, os.path -sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) - import lldbmi_testcase from lldbtest import * import unittest2 diff --git a/lldb/test/tools/lldb-mi/symbol/TestMiSymbol.py b/lldb/test/tools/lldb-mi/symbol/TestMiSymbol.py index 11b464b2e29..7cfceccbe84 100644 --- a/lldb/test/tools/lldb-mi/symbol/TestMiSymbol.py +++ b/lldb/test/tools/lldb-mi/symbol/TestMiSymbol.py @@ -2,10 +2,6 @@ Test lldb-mi -symbol-xxx commands. """ -# adjust path for lldbmi_testcase.py -import sys, os.path -sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) - import lldbmi_testcase from lldbtest import * import unittest2 diff --git a/lldb/test/tools/lldb-mi/syntax/TestMiSyntax.py b/lldb/test/tools/lldb-mi/syntax/TestMiSyntax.py index 90211a7ef21..e8dbb989a6b 100644 --- a/lldb/test/tools/lldb-mi/syntax/TestMiSyntax.py +++ b/lldb/test/tools/lldb-mi/syntax/TestMiSyntax.py @@ -2,10 +2,6 @@ Test that the lldb-mi driver understands MI command syntax. """ -# adjust path for lldbmi_testcase.py -import sys, os.path -sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) - import lldbmi_testcase from lldbtest import * import unittest2 diff --git a/lldb/test/tools/lldb-mi/variable/TestMiVar.py b/lldb/test/tools/lldb-mi/variable/TestMiVar.py index 1e076300da3..152e328e5c9 100644 --- a/lldb/test/tools/lldb-mi/variable/TestMiVar.py +++ b/lldb/test/tools/lldb-mi/variable/TestMiVar.py @@ -2,10 +2,6 @@ Test lldb-mi -var-xxx commands. """ -# adjust path for lldbmi_testcase.py -import sys, os.path -sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) - import lldbmi_testcase from lldbtest import * import unittest2 diff --git a/lldb/test/tools/lldb-server/commandline/TestStubReverseConnect.py b/lldb/test/tools/lldb-server/commandline/TestStubReverseConnect.py index e51f97c45b0..8701f92c5d7 100644 --- a/lldb/test/tools/lldb-server/commandline/TestStubReverseConnect.py +++ b/lldb/test/tools/lldb-server/commandline/TestStubReverseConnect.py @@ -1,9 +1,3 @@ -# Add the directory above ours to the python library path since we -# will import from there. -import os.path -import sys -sys.path.append(os.path.join(os.path.dirname(__file__), "..")) - import gdbremote_testcase import lldbgdbserverutils import re diff --git a/lldb/test/tools/lldb-server/commandline/TestStubSetSID.py b/lldb/test/tools/lldb-server/commandline/TestStubSetSID.py index 6564593e061..49509d6b3c8 100644 --- a/lldb/test/tools/lldb-server/commandline/TestStubSetSID.py +++ b/lldb/test/tools/lldb-server/commandline/TestStubSetSID.py @@ -1,11 +1,5 @@ import unittest2 -# Add the directory above ours to the python library path since we -# will import from there. -import os.path -import sys -sys.path.append(os.path.join(os.path.dirname(__file__), "..")) - import gdbremote_testcase import lldbgdbserverutils import os diff --git a/lldb/test/tools/lldb-server/inferior-crash/TestGdbRemoteAbort.py b/lldb/test/tools/lldb-server/inferior-crash/TestGdbRemoteAbort.py index 16ca370f300..fe4a6adda1f 100644 --- a/lldb/test/tools/lldb-server/inferior-crash/TestGdbRemoteAbort.py +++ b/lldb/test/tools/lldb-server/inferior-crash/TestGdbRemoteAbort.py @@ -1,11 +1,5 @@ import unittest2 -# Add the directory above ours to the python library path since we -# will import from there. -import os.path -import sys -sys.path.append(os.path.join(os.path.dirname(__file__), "..")) - import gdbremote_testcase import signal from lldbtest import * diff --git a/lldb/test/tools/lldb-server/inferior-crash/TestGdbRemoteSegFault.py b/lldb/test/tools/lldb-server/inferior-crash/TestGdbRemoteSegFault.py index c7494bdb7ef..664a7828f73 100644 --- a/lldb/test/tools/lldb-server/inferior-crash/TestGdbRemoteSegFault.py +++ b/lldb/test/tools/lldb-server/inferior-crash/TestGdbRemoteSegFault.py @@ -1,11 +1,5 @@ import unittest2 -# Add the directory above ours to the python library path since we -# will import from there. -import os.path -import sys -sys.path.append(os.path.join(os.path.dirname(__file__), "..")) - import gdbremote_testcase import signal from lldbtest import * diff --git a/lldb/test/tools/lldb-server/test/test_lldbgdbserverutils.py b/lldb/test/tools/lldb-server/test/test_lldbgdbserverutils.py index 5442681a191..034714e586c 100644 --- a/lldb/test/tools/lldb-server/test/test_lldbgdbserverutils.py +++ b/lldb/test/tools/lldb-server/test/test_lldbgdbserverutils.py @@ -2,12 +2,8 @@ import os.path import re import sys -# adjust path for embedded unittest2 -sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', '..', '..')) import unittest2 -# adjust path for lldbgdbserverutils.py -sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '..')) from lldbgdbserverutils import * |