diff options
author | Zachary Turner <zturner@google.com> | 2015-11-03 02:06:18 +0000 |
---|---|---|
committer | Zachary Turner <zturner@google.com> | 2015-11-03 02:06:18 +0000 |
commit | 95c453a221d5e757830145c2d5198c3a9da3f4b2 (patch) | |
tree | aa824a74049518ed35ff67e2182f2dfcceac0658 /lldb/packages/Python/lldbsuite/test/functionalities/thread | |
parent | 6f4ed269b9f4d8296f2002f5d96fcc5d8a9ef7b1 (diff) | |
download | bcm5719-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/functionalities/thread')
14 files changed, 29 insertions, 28 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/thread/TestNumThreads.py b/lldb/packages/Python/lldbsuite/test/functionalities/thread/TestNumThreads.py index 28d51813644..cb294ff70e8 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/thread/TestNumThreads.py +++ b/lldb/packages/Python/lldbsuite/test/functionalities/thread/TestNumThreads.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 NumberOfThreadsTestCase(TestBase): diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/thread/break_after_join/TestBreakAfterJoin.py b/lldb/packages/Python/lldbsuite/test/functionalities/thread/break_after_join/TestBreakAfterJoin.py index cf12693c7b5..6b11387d38c 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/thread/break_after_join/TestBreakAfterJoin.py +++ b/lldb/packages/Python/lldbsuite/test/functionalities/thread/break_after_join/TestBreakAfterJoin.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 BreakpointAfterJoinTestCase(TestBase): diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentEvents.py b/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentEvents.py index 80ebb7c6e13..27876fd82c3 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentEvents.py +++ b/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentEvents.py @@ -17,8 +17,8 @@ import use_lldb_suite import unittest2 import os, time import lldb -from lldbtest import * -import lldbutil +from lldbsuite.test.lldbtest import * +import lldbsuite.test.lldbutil as lldbutil @skipIfWindows class ConcurrentEventsTestCase(TestBase): diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/thread/crash_during_step/TestCrashDuringStep.py b/lldb/packages/Python/lldbsuite/test/functionalities/thread/crash_during_step/TestCrashDuringStep.py index e2fce436473..f353e2056a0 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/thread/crash_during_step/TestCrashDuringStep.py +++ b/lldb/packages/Python/lldbsuite/test/functionalities/thread/crash_during_step/TestCrashDuringStep.py @@ -8,8 +8,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 CreateDuringStepTestCase(TestBase): diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/thread/create_after_attach/TestCreateAfterAttach.py b/lldb/packages/Python/lldbsuite/test/functionalities/thread/create_after_attach/TestCreateAfterAttach.py index 6e363a3ffe6..46fc853212d 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/thread/create_after_attach/TestCreateAfterAttach.py +++ b/lldb/packages/Python/lldbsuite/test/functionalities/thread/create_after_attach/TestCreateAfterAttach.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 CreateAfterAttachTestCase(TestBase): diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/thread/create_during_step/TestCreateDuringStep.py b/lldb/packages/Python/lldbsuite/test/functionalities/thread/create_during_step/TestCreateDuringStep.py index 0267f2e4776..32ae33f1230 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/thread/create_during_step/TestCreateDuringStep.py +++ b/lldb/packages/Python/lldbsuite/test/functionalities/thread/create_during_step/TestCreateDuringStep.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 CreateDuringStepTestCase(TestBase): diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/thread/exit_during_break/TestExitDuringBreak.py b/lldb/packages/Python/lldbsuite/test/functionalities/thread/exit_during_break/TestExitDuringBreak.py index 261c524c9de..e6e9c316f99 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/thread/exit_during_break/TestExitDuringBreak.py +++ b/lldb/packages/Python/lldbsuite/test/functionalities/thread/exit_during_break/TestExitDuringBreak.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 ExitDuringBreakpointTestCase(TestBase): diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/thread/exit_during_step/TestExitDuringStep.py b/lldb/packages/Python/lldbsuite/test/functionalities/thread/exit_during_step/TestExitDuringStep.py index d5e83dc4be3..1460b006ed8 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/thread/exit_during_step/TestExitDuringStep.py +++ b/lldb/packages/Python/lldbsuite/test/functionalities/thread/exit_during_step/TestExitDuringStep.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 ExitDuringStepTestCase(TestBase): diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/thread/jump/TestThreadJump.py b/lldb/packages/Python/lldbsuite/test/functionalities/thread/jump/TestThreadJump.py index 1c0b32dc6d9..e0f580dd94b 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/thread/jump/TestThreadJump.py +++ b/lldb/packages/Python/lldbsuite/test/functionalities/thread/jump/TestThreadJump.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 ThreadJumpTestCase(TestBase): diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/thread/multi_break/TestMultipleBreakpoints.py b/lldb/packages/Python/lldbsuite/test/functionalities/thread/multi_break/TestMultipleBreakpoints.py index fc81fa98c73..4f252b5ead3 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/thread/multi_break/TestMultipleBreakpoints.py +++ b/lldb/packages/Python/lldbsuite/test/functionalities/thread/multi_break/TestMultipleBreakpoints.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 MultipleBreakpointTestCase(TestBase): diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/thread/state/TestThreadStates.py b/lldb/packages/Python/lldbsuite/test/functionalities/thread/state/TestThreadStates.py index dc20507ad87..ec88b75502f 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/thread/state/TestThreadStates.py +++ b/lldb/packages/Python/lldbsuite/test/functionalities/thread/state/TestThreadStates.py @@ -9,8 +9,8 @@ import use_lldb_suite import unittest2 import os, time import lldb -from lldbtest import * -import lldbutil +from lldbsuite.test.lldbtest import * +import lldbsuite.test.lldbutil as lldbutil class ThreadStateTestCase(TestBase): diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/thread/step_out/TestThreadStepOut.py b/lldb/packages/Python/lldbsuite/test/functionalities/thread/step_out/TestThreadStepOut.py index 7ef1460d2f5..9b79aed89a8 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/thread/step_out/TestThreadStepOut.py +++ b/lldb/packages/Python/lldbsuite/test/functionalities/thread/step_out/TestThreadStepOut.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 ThreadStepOutTestCase(TestBase): diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/thread/thread_exit/TestThreadExit.py b/lldb/packages/Python/lldbsuite/test/functionalities/thread/thread_exit/TestThreadExit.py index 89f65f9b505..83db997a953 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/thread/thread_exit/TestThreadExit.py +++ b/lldb/packages/Python/lldbsuite/test/functionalities/thread/thread_exit/TestThreadExit.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 ThreadExitTestCase(TestBase): diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/thread/thread_specific_break/TestThreadSpecificBreakpoint.py b/lldb/packages/Python/lldbsuite/test/functionalities/thread/thread_specific_break/TestThreadSpecificBreakpoint.py index 29d3c489b2b..2bfd8d5b400 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/thread/thread_specific_break/TestThreadSpecificBreakpoint.py +++ b/lldb/packages/Python/lldbsuite/test/functionalities/thread/thread_specific_break/TestThreadSpecificBreakpoint.py @@ -8,8 +8,9 @@ import use_lldb_suite import os, time import re -import lldb, lldbutil -from lldbtest import * +import lldb +import lldbsuite.test.lldbutil as lldbutil +from lldbsuite.test.lldbtest import * class ThreadSpecificBreakTestCase(TestBase): |