Skip to content

Commit ba6d7b6

Browse files
committedMar 12, 2015
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
1 parent 5d06b4c commit ba6d7b6

File tree

16 files changed

+7
-71
lines changed

16 files changed

+7
-71
lines changed
 

‎lldb/test/dotest.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -932,14 +932,20 @@ def setupSysPath():
932932

933933
pluginPath = os.path.join(scriptPath, 'plugins')
934934
pexpectPath = os.path.join(scriptPath, 'pexpect-2.4')
935+
toolsLLDBMIPath = os.path.join(scriptPath, 'tools', 'lldb-mi')
936+
toolsLLDBServerPath = os.path.join(scriptPath, 'tools', 'lldb-server')
935937

936938
# Put embedded pexpect at front of the load path so we ensure we
937939
# use that version.
938940
sys.path.insert(0, pexpectPath)
939941

940-
# Append script dir and plugin dir to the sys.path.
942+
# Append script dir, plugin dir, lldb-mi dir and lldb-server dir to the sys.path.
941943
sys.path.append(scriptPath)
942944
sys.path.append(pluginPath)
945+
sys.path.append(toolsLLDBMIPath) # Adding test/tools/lldb-mi to the path makes it easy
946+
# to "import lldbmi_testcase" from the MI tests
947+
sys.path.append(toolsLLDBServerPath) # Adding test/tools/lldb-server to the path makes it easy
948+
# to "import lldbgdbserverutils" from the lldb-server tests
943949

944950
# This is our base name component.
945951
base = os.path.abspath(os.path.join(scriptPath, os.pardir))

‎lldb/test/tools/lldb-mi/breakpoint/TestMiBreak.py

-4
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22
Test lldb-mi -break-xxx commands.
33
"""
44

5-
# adjust path for lldbmi_testcase.py
6-
import sys, os.path
7-
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
8-
95
import lldbmi_testcase
106
from lldbtest import *
117
import unittest2

‎lldb/test/tools/lldb-mi/control/TestMiExec.py

-4
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22
Test lldb-mi -exec-xxx commands.
33
"""
44

5-
# adjust path for lldbmi_testcase.py
6-
import sys, os.path
7-
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
8-
95
import lldbmi_testcase
106
from lldbtest import *
117
import unittest2

‎lldb/test/tools/lldb-mi/data/TestMiData.py

-4
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22
Test lldb-mi -data-xxx commands.
33
"""
44

5-
# adjust path for lldbmi_testcase.py
6-
import sys, os.path
7-
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
8-
95
import lldbmi_testcase
106
from lldbtest import *
117
import unittest2

‎lldb/test/tools/lldb-mi/interpreter/TestMiInterpreterExec.py

-4
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22
Test lldb-mi -interpreter-exec command.
33
"""
44

5-
# adjust path for lldbmi_testcase.py
6-
import sys, os.path
7-
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
8-
95
import lldbmi_testcase
106
from lldbtest import *
117
import unittest2

‎lldb/test/tools/lldb-mi/signal/TestMiSignal.py

-6
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22
Test that the lldb-mi handles signals properly.
33
"""
44

5-
# adjust path for lldbmi_testcase.py
6-
import sys, os.path
7-
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
8-
95
import lldbmi_testcase
106
from lldbtest import *
117
import unittest2
@@ -90,7 +86,6 @@ def test_lldbmi_stopped_when_stopatentry_remote(self):
9086
"""Test that 'lldb-mi --interpreter' notifies after it was stopped on entry (remote)."""
9187

9288
# Prepare debugserver
93-
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..", "lldb-server")))
9489
import lldbgdbserverutils
9590
debugserver_exe = lldbgdbserverutils.get_debugserver_exe()
9691
if not debugserver_exe:
@@ -167,7 +162,6 @@ def test_lldbmi_stopped_when_segfault_remote(self):
167162
"""Test that 'lldb-mi --interpreter' notifies after it was stopped when segfault occurred (remote)."""
168163

169164
# Prepare debugserver
170-
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..", "lldb-server")))
171165
import lldbgdbserverutils
172166
debugserver_exe = lldbgdbserverutils.get_debugserver_exe()
173167
if not debugserver_exe:

‎lldb/test/tools/lldb-mi/stack/TestMiStack.py

-4
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22
Test lldb-mi -stack-xxx commands.
33
"""
44

5-
# adjust path for lldbmi_testcase.py
6-
import sys, os.path
7-
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
8-
95
import lldbmi_testcase
106
from lldbtest import *
117
import unittest2

‎lldb/test/tools/lldb-mi/startup_options/TestMiStartupOptions.py

-4
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22
Test lldb-mi startup options.
33
"""
44

5-
# adjust path for lldbmi_testcase.py
6-
import sys, os.path
7-
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
8-
95
import lldbmi_testcase
106
from lldbtest import *
117
import unittest2

‎lldb/test/tools/lldb-mi/symbol/TestMiSymbol.py

-4
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22
Test lldb-mi -symbol-xxx commands.
33
"""
44

5-
# adjust path for lldbmi_testcase.py
6-
import sys, os.path
7-
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
8-
95
import lldbmi_testcase
106
from lldbtest import *
117
import unittest2

‎lldb/test/tools/lldb-mi/syntax/TestMiSyntax.py

-4
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22
Test that the lldb-mi driver understands MI command syntax.
33
"""
44

5-
# adjust path for lldbmi_testcase.py
6-
import sys, os.path
7-
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
8-
95
import lldbmi_testcase
106
from lldbtest import *
117
import unittest2

‎lldb/test/tools/lldb-mi/variable/TestMiVar.py

-4
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22
Test lldb-mi -var-xxx commands.
33
"""
44

5-
# adjust path for lldbmi_testcase.py
6-
import sys, os.path
7-
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
8-
95
import lldbmi_testcase
106
from lldbtest import *
117
import unittest2

‎lldb/test/tools/lldb-server/commandline/TestStubReverseConnect.py

-6
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
# Add the directory above ours to the python library path since we
2-
# will import from there.
3-
import os.path
4-
import sys
5-
sys.path.append(os.path.join(os.path.dirname(__file__), ".."))
6-
71
import gdbremote_testcase
82
import lldbgdbserverutils
93
import re

‎lldb/test/tools/lldb-server/commandline/TestStubSetSID.py

-6
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
import unittest2
22

3-
# Add the directory above ours to the python library path since we
4-
# will import from there.
5-
import os.path
6-
import sys
7-
sys.path.append(os.path.join(os.path.dirname(__file__), ".."))
8-
93
import gdbremote_testcase
104
import lldbgdbserverutils
115
import os

‎lldb/test/tools/lldb-server/inferior-crash/TestGdbRemoteAbort.py

-6
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
import unittest2
22

3-
# Add the directory above ours to the python library path since we
4-
# will import from there.
5-
import os.path
6-
import sys
7-
sys.path.append(os.path.join(os.path.dirname(__file__), ".."))
8-
93
import gdbremote_testcase
104
import signal
115
from lldbtest import *

‎lldb/test/tools/lldb-server/inferior-crash/TestGdbRemoteSegFault.py

-6
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
import unittest2
22

3-
# Add the directory above ours to the python library path since we
4-
# will import from there.
5-
import os.path
6-
import sys
7-
sys.path.append(os.path.join(os.path.dirname(__file__), ".."))
8-
93
import gdbremote_testcase
104
import signal
115
from lldbtest import *

‎lldb/test/tools/lldb-server/test/test_lldbgdbserverutils.py

-4
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,8 @@
22
import re
33
import sys
44

5-
# adjust path for embedded unittest2
6-
sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', '..', '..'))
75
import unittest2
86

9-
# adjust path for lldbgdbserverutils.py
10-
sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '..'))
117
from lldbgdbserverutils import *
128

139

0 commit comments

Comments
 (0)
Please sign in to comment.