summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test/expression_command
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2015-11-03 02:06:18 +0000
committerZachary Turner <zturner@google.com>2015-11-03 02:06:18 +0000
commit95c453a221d5e757830145c2d5198c3a9da3f4b2 (patch)
treeaa824a74049518ed35ff67e2182f2dfcceac0658 /lldb/packages/Python/lldbsuite/test/expression_command
parent6f4ed269b9f4d8296f2002f5d96fcc5d8a9ef7b1 (diff)
downloadbcm5719-llvm-95c453a221d5e757830145c2d5198c3a9da3f4b2.tar.gz
bcm5719-llvm-95c453a221d5e757830145c2d5198c3a9da3f4b2.zip
Tighten up sys.path, and use absolute imports everywhere.
For convenience, we had added the folder that dotest.py was in to sys.path, so that we could easily write things like `import lldbutil` from anywhere and any test. This introduces a subtle problem when using Python's package system, because when unittest2 imports a particular test suite, the test suite is detached from the package. Thus, writing "import lldbutil" from dotest imports it as part of the package, and writing the same line from a test does a fresh import since the importing module was not part of the same package. The real way to fix this is to use absolute imports everywhere. Instead of writing "import lldbutil", we need to write "import lldbsuite.test.util". This patch fixes up that and all other similar cases, and additionally removes the script directory from sys.path to ensure that this can't happen again. llvm-svn: 251886
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/expression_command')
-rw-r--r--lldb/packages/Python/lldbsuite/test/expression_command/call-function/TestCallStdStringFunction.py4
-rw-r--r--lldb/packages/Python/lldbsuite/test/expression_command/call-function/TestCallStopAndContinue.py4
-rw-r--r--lldb/packages/Python/lldbsuite/test/expression_command/call-function/TestCallUserDefinedFunction.py4
-rw-r--r--lldb/packages/Python/lldbsuite/test/expression_command/call-restarts/TestCallThatRestarts.py4
-rw-r--r--lldb/packages/Python/lldbsuite/test/expression_command/call-throws/TestCallThatThrows.py4
-rw-r--r--lldb/packages/Python/lldbsuite/test/expression_command/char/TestExprsChar.py4
-rw-r--r--lldb/packages/Python/lldbsuite/test/expression_command/expr-in-syscall/TestExpressionInSyscall.py4
-rw-r--r--lldb/packages/Python/lldbsuite/test/expression_command/formatters/TestFormatters.py4
-rw-r--r--lldb/packages/Python/lldbsuite/test/expression_command/issue_11588/Test11588.py4
-rw-r--r--lldb/packages/Python/lldbsuite/test/expression_command/options/TestExprOptions.py4
-rw-r--r--lldb/packages/Python/lldbsuite/test/expression_command/persist_objc_pointeetype/TestPersistObjCPointeeType.py4
-rw-r--r--lldb/packages/Python/lldbsuite/test/expression_command/persistent_ptr_update/TestPersistentPtrUpdate.py4
-rw-r--r--lldb/packages/Python/lldbsuite/test/expression_command/persistent_types/TestNestedPersistentTypes.py2
-rw-r--r--lldb/packages/Python/lldbsuite/test/expression_command/persistent_types/TestPersistentTypes.py2
-rw-r--r--lldb/packages/Python/lldbsuite/test/expression_command/persistent_variables/TestPersistentVariables.py2
-rw-r--r--lldb/packages/Python/lldbsuite/test/expression_command/po_verbosity/TestPoVerbosity.py4
-rw-r--r--lldb/packages/Python/lldbsuite/test/expression_command/radar_8638051/Test8638051.py2
-rw-r--r--lldb/packages/Python/lldbsuite/test/expression_command/radar_9531204/TestPrintfAfterUp.py4
-rw-r--r--lldb/packages/Python/lldbsuite/test/expression_command/radar_9673664/TestExprHelpExamples.py4
-rw-r--r--lldb/packages/Python/lldbsuite/test/expression_command/test/TestExprs.py6
-rw-r--r--lldb/packages/Python/lldbsuite/test/expression_command/test/TestExprs2.py4
-rw-r--r--lldb/packages/Python/lldbsuite/test/expression_command/timeout/TestCallWithTimeout.py4
-rw-r--r--lldb/packages/Python/lldbsuite/test/expression_command/two-files/TestObjCTypeQueryFromOtherCompileUnit.py4
23 files changed, 43 insertions, 43 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/expression_command/call-function/TestCallStdStringFunction.py b/lldb/packages/Python/lldbsuite/test/expression_command/call-function/TestCallStdStringFunction.py
index 11caf627744..2ff0840c637 100644
--- a/lldb/packages/Python/lldbsuite/test/expression_command/call-function/TestCallStdStringFunction.py
+++ b/lldb/packages/Python/lldbsuite/test/expression_command/call-function/TestCallStdStringFunction.py
@@ -7,8 +7,8 @@ from __future__ import print_function
import use_lldb_suite
import lldb
-import lldbutil
-from lldbtest import *
+import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test.lldbtest import *
class ExprCommandCallFunctionTestCase(TestBase):
diff --git a/lldb/packages/Python/lldbsuite/test/expression_command/call-function/TestCallStopAndContinue.py b/lldb/packages/Python/lldbsuite/test/expression_command/call-function/TestCallStopAndContinue.py
index 1cd2d83373f..5832bf41785 100644
--- a/lldb/packages/Python/lldbsuite/test/expression_command/call-function/TestCallStopAndContinue.py
+++ b/lldb/packages/Python/lldbsuite/test/expression_command/call-function/TestCallStopAndContinue.py
@@ -7,8 +7,8 @@ from __future__ import print_function
import use_lldb_suite
import lldb
-import lldbutil
-from lldbtest import *
+import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test.lldbtest import *
class ExprCommandCallStopContinueTestCase(TestBase):
diff --git a/lldb/packages/Python/lldbsuite/test/expression_command/call-function/TestCallUserDefinedFunction.py b/lldb/packages/Python/lldbsuite/test/expression_command/call-function/TestCallUserDefinedFunction.py
index 3b101285750..700c22ca4b9 100644
--- a/lldb/packages/Python/lldbsuite/test/expression_command/call-function/TestCallUserDefinedFunction.py
+++ b/lldb/packages/Python/lldbsuite/test/expression_command/call-function/TestCallUserDefinedFunction.py
@@ -12,8 +12,8 @@ from __future__ import print_function
import use_lldb_suite
import lldb
-import lldbutil
-from lldbtest import *
+import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test.lldbtest import *
class ExprCommandCallUserDefinedFunction(TestBase):
diff --git a/lldb/packages/Python/lldbsuite/test/expression_command/call-restarts/TestCallThatRestarts.py b/lldb/packages/Python/lldbsuite/test/expression_command/call-restarts/TestCallThatRestarts.py
index 38f0ab73db4..4cae0d335eb 100644
--- a/lldb/packages/Python/lldbsuite/test/expression_command/call-restarts/TestCallThatRestarts.py
+++ b/lldb/packages/Python/lldbsuite/test/expression_command/call-restarts/TestCallThatRestarts.py
@@ -7,8 +7,8 @@ from __future__ import print_function
import use_lldb_suite
import lldb
-import lldbutil
-from lldbtest import *
+import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test.lldbtest import *
class ExprCommandThatRestartsTestCase(TestBase):
diff --git a/lldb/packages/Python/lldbsuite/test/expression_command/call-throws/TestCallThatThrows.py b/lldb/packages/Python/lldbsuite/test/expression_command/call-throws/TestCallThatThrows.py
index 874c9f7da07..1749365778f 100644
--- a/lldb/packages/Python/lldbsuite/test/expression_command/call-throws/TestCallThatThrows.py
+++ b/lldb/packages/Python/lldbsuite/test/expression_command/call-throws/TestCallThatThrows.py
@@ -7,8 +7,8 @@ from __future__ import print_function
import use_lldb_suite
import lldb
-import lldbutil
-from lldbtest import *
+import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test.lldbtest import *
class ExprCommandWithThrowTestCase(TestBase):
diff --git a/lldb/packages/Python/lldbsuite/test/expression_command/char/TestExprsChar.py b/lldb/packages/Python/lldbsuite/test/expression_command/char/TestExprsChar.py
index cb57fdb1b7b..45b64c4ed2b 100644
--- a/lldb/packages/Python/lldbsuite/test/expression_command/char/TestExprsChar.py
+++ b/lldb/packages/Python/lldbsuite/test/expression_command/char/TestExprsChar.py
@@ -3,8 +3,8 @@ from __future__ import print_function
import use_lldb_suite
import lldb
-import lldbutil
-from lldbtest import *
+import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test.lldbtest import *
class ExprCharTestCase(TestBase):
diff --git a/lldb/packages/Python/lldbsuite/test/expression_command/expr-in-syscall/TestExpressionInSyscall.py b/lldb/packages/Python/lldbsuite/test/expression_command/expr-in-syscall/TestExpressionInSyscall.py
index f115f13f773..5546841f4e8 100644
--- a/lldb/packages/Python/lldbsuite/test/expression_command/expr-in-syscall/TestExpressionInSyscall.py
+++ b/lldb/packages/Python/lldbsuite/test/expression_command/expr-in-syscall/TestExpressionInSyscall.py
@@ -6,8 +6,8 @@ import use_lldb_suite
import os
import lldb
-from lldbtest import *
-import lldbutil
+from lldbsuite.test.lldbtest import *
+import lldbsuite.test.lldbutil as lldbutil
class ExprSyscallTestCase(TestBase):
diff --git a/lldb/packages/Python/lldbsuite/test/expression_command/formatters/TestFormatters.py b/lldb/packages/Python/lldbsuite/test/expression_command/formatters/TestFormatters.py
index 6fb6cd8bcd7..e4948fd6623 100644
--- a/lldb/packages/Python/lldbsuite/test/expression_command/formatters/TestFormatters.py
+++ b/lldb/packages/Python/lldbsuite/test/expression_command/formatters/TestFormatters.py
@@ -7,8 +7,8 @@ from __future__ import print_function
import use_lldb_suite
import lldb
-import lldbutil
-from lldbtest import *
+import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test.lldbtest import *
class ExprFormattersTestCase(TestBase):
diff --git a/lldb/packages/Python/lldbsuite/test/expression_command/issue_11588/Test11588.py b/lldb/packages/Python/lldbsuite/test/expression_command/issue_11588/Test11588.py
index 5941cb50946..7140fc349f2 100644
--- a/lldb/packages/Python/lldbsuite/test/expression_command/issue_11588/Test11588.py
+++ b/lldb/packages/Python/lldbsuite/test/expression_command/issue_11588/Test11588.py
@@ -10,8 +10,8 @@ import use_lldb_suite
import os, time
import lldb
-import lldbutil
-from lldbtest import *
+import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test.lldbtest import *
class Issue11581TestCase(TestBase):
diff --git a/lldb/packages/Python/lldbsuite/test/expression_command/options/TestExprOptions.py b/lldb/packages/Python/lldbsuite/test/expression_command/options/TestExprOptions.py
index 2c0eb6551ea..d725256b206 100644
--- a/lldb/packages/Python/lldbsuite/test/expression_command/options/TestExprOptions.py
+++ b/lldb/packages/Python/lldbsuite/test/expression_command/options/TestExprOptions.py
@@ -13,8 +13,8 @@ import use_lldb_suite
import os, time
import lldb
-import lldbutil
-from lldbtest import *
+import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test.lldbtest import *
class ExprOptionsTestCase(TestBase):
diff --git a/lldb/packages/Python/lldbsuite/test/expression_command/persist_objc_pointeetype/TestPersistObjCPointeeType.py b/lldb/packages/Python/lldbsuite/test/expression_command/persist_objc_pointeetype/TestPersistObjCPointeeType.py
index e959450a5c7..b7ed53ed67d 100644
--- a/lldb/packages/Python/lldbsuite/test/expression_command/persist_objc_pointeetype/TestPersistObjCPointeeType.py
+++ b/lldb/packages/Python/lldbsuite/test/expression_command/persist_objc_pointeetype/TestPersistObjCPointeeType.py
@@ -7,8 +7,8 @@ from __future__ import print_function
import use_lldb_suite
import lldb
-import lldbutil
-from lldbtest import *
+import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test.lldbtest import *
class PersistObjCPointeeType(TestBase):
diff --git a/lldb/packages/Python/lldbsuite/test/expression_command/persistent_ptr_update/TestPersistentPtrUpdate.py b/lldb/packages/Python/lldbsuite/test/expression_command/persistent_ptr_update/TestPersistentPtrUpdate.py
index 8d3e31d1632..36ff8d22346 100644
--- a/lldb/packages/Python/lldbsuite/test/expression_command/persistent_ptr_update/TestPersistentPtrUpdate.py
+++ b/lldb/packages/Python/lldbsuite/test/expression_command/persistent_ptr_update/TestPersistentPtrUpdate.py
@@ -7,8 +7,8 @@ from __future__ import print_function
import use_lldb_suite
import lldb
-import lldbutil
-from lldbtest import *
+import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test.lldbtest import *
class PersistentPtrUpdateTestCase(TestBase):
diff --git a/lldb/packages/Python/lldbsuite/test/expression_command/persistent_types/TestNestedPersistentTypes.py b/lldb/packages/Python/lldbsuite/test/expression_command/persistent_types/TestNestedPersistentTypes.py
index fdc8b68bddd..cf2bf13d24d 100644
--- a/lldb/packages/Python/lldbsuite/test/expression_command/persistent_types/TestNestedPersistentTypes.py
+++ b/lldb/packages/Python/lldbsuite/test/expression_command/persistent_types/TestNestedPersistentTypes.py
@@ -8,7 +8,7 @@ import use_lldb_suite
import os, time
import lldb
-from lldbtest import *
+from lldbsuite.test.lldbtest import *
class NestedPersistentTypesTestCase(TestBase):
diff --git a/lldb/packages/Python/lldbsuite/test/expression_command/persistent_types/TestPersistentTypes.py b/lldb/packages/Python/lldbsuite/test/expression_command/persistent_types/TestPersistentTypes.py
index 48ee99fe780..213a91f3bb7 100644
--- a/lldb/packages/Python/lldbsuite/test/expression_command/persistent_types/TestPersistentTypes.py
+++ b/lldb/packages/Python/lldbsuite/test/expression_command/persistent_types/TestPersistentTypes.py
@@ -8,7 +8,7 @@ import use_lldb_suite
import os, time
import lldb
-from lldbtest import *
+from lldbsuite.test.lldbtest import *
class PersistenttypesTestCase(TestBase):
diff --git a/lldb/packages/Python/lldbsuite/test/expression_command/persistent_variables/TestPersistentVariables.py b/lldb/packages/Python/lldbsuite/test/expression_command/persistent_variables/TestPersistentVariables.py
index 6790014f5e6..e945597c808 100644
--- a/lldb/packages/Python/lldbsuite/test/expression_command/persistent_variables/TestPersistentVariables.py
+++ b/lldb/packages/Python/lldbsuite/test/expression_command/persistent_variables/TestPersistentVariables.py
@@ -8,7 +8,7 @@ import use_lldb_suite
import os, time
import lldb
-from lldbtest import *
+from lldbsuite.test.lldbtest import *
class PersistentVariablesTestCase(TestBase):
diff --git a/lldb/packages/Python/lldbsuite/test/expression_command/po_verbosity/TestPoVerbosity.py b/lldb/packages/Python/lldbsuite/test/expression_command/po_verbosity/TestPoVerbosity.py
index b50cc262586..7661f720b4b 100644
--- a/lldb/packages/Python/lldbsuite/test/expression_command/po_verbosity/TestPoVerbosity.py
+++ b/lldb/packages/Python/lldbsuite/test/expression_command/po_verbosity/TestPoVerbosity.py
@@ -7,8 +7,8 @@ from __future__ import print_function
import use_lldb_suite
import lldb
-import lldbutil
-from lldbtest import *
+import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test.lldbtest import *
class PoVerbosityTestCase(TestBase):
diff --git a/lldb/packages/Python/lldbsuite/test/expression_command/radar_8638051/Test8638051.py b/lldb/packages/Python/lldbsuite/test/expression_command/radar_8638051/Test8638051.py
index 3b61a468848..b571639f2a6 100644
--- a/lldb/packages/Python/lldbsuite/test/expression_command/radar_8638051/Test8638051.py
+++ b/lldb/packages/Python/lldbsuite/test/expression_command/radar_8638051/Test8638051.py
@@ -8,7 +8,7 @@ import use_lldb_suite
import os, time
import lldb
-from lldbtest import *
+from lldbsuite.test.lldbtest import *
class Radar8638051TestCase(TestBase):
diff --git a/lldb/packages/Python/lldbsuite/test/expression_command/radar_9531204/TestPrintfAfterUp.py b/lldb/packages/Python/lldbsuite/test/expression_command/radar_9531204/TestPrintfAfterUp.py
index e7821a68f29..964bc6a26eb 100644
--- a/lldb/packages/Python/lldbsuite/test/expression_command/radar_9531204/TestPrintfAfterUp.py
+++ b/lldb/packages/Python/lldbsuite/test/expression_command/radar_9531204/TestPrintfAfterUp.py
@@ -8,8 +8,8 @@ import use_lldb_suite
import os, time
import lldb
-from lldbtest import *
-import lldbutil
+from lldbsuite.test.lldbtest import *
+import lldbsuite.test.lldbutil as lldbutil
class Radar9531204TestCase(TestBase):
diff --git a/lldb/packages/Python/lldbsuite/test/expression_command/radar_9673664/TestExprHelpExamples.py b/lldb/packages/Python/lldbsuite/test/expression_command/radar_9673664/TestExprHelpExamples.py
index 7d7c8ed046c..fb2d32e3b14 100644
--- a/lldb/packages/Python/lldbsuite/test/expression_command/radar_9673664/TestExprHelpExamples.py
+++ b/lldb/packages/Python/lldbsuite/test/expression_command/radar_9673664/TestExprHelpExamples.py
@@ -8,8 +8,8 @@ import use_lldb_suite
import os, time
import lldb
-from lldbtest import *
-import lldbutil
+from lldbsuite.test.lldbtest import *
+import lldbsuite.test.lldbutil as lldbutil
class Radar9673644TestCase(TestBase):
diff --git a/lldb/packages/Python/lldbsuite/test/expression_command/test/TestExprs.py b/lldb/packages/Python/lldbsuite/test/expression_command/test/TestExprs.py
index 70d36896dcd..765359e77ad 100644
--- a/lldb/packages/Python/lldbsuite/test/expression_command/test/TestExprs.py
+++ b/lldb/packages/Python/lldbsuite/test/expression_command/test/TestExprs.py
@@ -19,8 +19,8 @@ import unittest2
import os, time
import lldb
-import lldbutil
-from lldbtest import *
+import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test.lldbtest import *
class BasicExprCommandsTestCase(TestBase):
@@ -135,7 +135,7 @@ class BasicExprCommandsTestCase(TestBase):
# The stop reason of the thread should be breakpoint.
thread = process.GetThreadAtIndex(0)
if thread.GetStopReason() != lldb.eStopReasonBreakpoint:
- from lldbutil import stop_reason_to_str
+ from lldbsuite.test.lldbutil import stop_reason_to_str
self.fail(STOPPED_DUE_TO_BREAKPOINT_WITH_STOP_REASON_AS %
stop_reason_to_str(thread.GetStopReason()))
diff --git a/lldb/packages/Python/lldbsuite/test/expression_command/test/TestExprs2.py b/lldb/packages/Python/lldbsuite/test/expression_command/test/TestExprs2.py
index 672521dd1d1..eff37ea7c35 100644
--- a/lldb/packages/Python/lldbsuite/test/expression_command/test/TestExprs2.py
+++ b/lldb/packages/Python/lldbsuite/test/expression_command/test/TestExprs2.py
@@ -8,8 +8,8 @@ import use_lldb_suite
import os
import lldb
-import lldbutil
-from lldbtest import *
+import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test.lldbtest import *
class ExprCommands2TestCase(TestBase):
diff --git a/lldb/packages/Python/lldbsuite/test/expression_command/timeout/TestCallWithTimeout.py b/lldb/packages/Python/lldbsuite/test/expression_command/timeout/TestCallWithTimeout.py
index 6e3e8879073..a3118a594bd 100644
--- a/lldb/packages/Python/lldbsuite/test/expression_command/timeout/TestCallWithTimeout.py
+++ b/lldb/packages/Python/lldbsuite/test/expression_command/timeout/TestCallWithTimeout.py
@@ -7,8 +7,8 @@ from __future__ import print_function
import use_lldb_suite
import lldb
-import lldbutil
-from lldbtest import *
+import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test.lldbtest import *
class ExprCommandWithTimeoutsTestCase(TestBase):
diff --git a/lldb/packages/Python/lldbsuite/test/expression_command/two-files/TestObjCTypeQueryFromOtherCompileUnit.py b/lldb/packages/Python/lldbsuite/test/expression_command/two-files/TestObjCTypeQueryFromOtherCompileUnit.py
index 7e67b334e4d..fff1e4085cc 100644
--- a/lldb/packages/Python/lldbsuite/test/expression_command/two-files/TestObjCTypeQueryFromOtherCompileUnit.py
+++ b/lldb/packages/Python/lldbsuite/test/expression_command/two-files/TestObjCTypeQueryFromOtherCompileUnit.py
@@ -9,8 +9,8 @@ from __future__ import print_function
import use_lldb_suite
import lldb
-from lldbtest import *
-import lldbutil
+from lldbsuite.test.lldbtest import *
+import lldbsuite.test.lldbutil as lldbutil
class ObjCTypeQueryTestCase(TestBase):
OpenPOWER on IntegriCloud