aboutsummaryrefslogtreecommitdiff
path: root/lldb/packages/Python/lldbsuite/test
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test')
-rw-r--r--lldb/packages/Python/lldbsuite/test/README-TestSuite4
-rw-r--r--lldb/packages/Python/lldbsuite/test/lldbtest.py13
2 files changed, 4 insertions, 13 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/README-TestSuite b/lldb/packages/Python/lldbsuite/test/README-TestSuite
index b29b5a3..4e1a8c0 100644
--- a/lldb/packages/Python/lldbsuite/test/README-TestSuite
+++ b/lldb/packages/Python/lldbsuite/test/README-TestSuite
@@ -33,9 +33,7 @@ to the Python test suite under the current 'test' directory.
./command_source/TestCommandSource.py provides a simple example of test case
which overrides lldbtest.TestBase to exercise the lldb's 'command source'
- command. The subclass should override the attribute 'mydir' in order for the
- runtime to locate the individual test cases when running as part of a large
- test suite or when running each test case as a separate Python invocation.
+ command.
The doc string provides more details about the setup required for running a
test case on its own. To run the whole test suite, 'dotest.py' is all you
diff --git a/lldb/packages/Python/lldbsuite/test/lldbtest.py b/lldb/packages/Python/lldbsuite/test/lldbtest.py
index c3dc2a9..2285173 100644
--- a/lldb/packages/Python/lldbsuite/test/lldbtest.py
+++ b/lldb/packages/Python/lldbsuite/test/lldbtest.py
@@ -4,10 +4,6 @@ LLDB module which provides the abstract base class of lldb test case.
The concrete subclass can override lldbtest.TestBase in order to inherit the
common behavior for unitest.TestCase.setUp/tearDown implemented in this file.
-The subclass should override the attribute mydir in order for the python runtime
-to locate the individual test cases when running as part of a large test suite
-or when running each test case as a separate python invocation.
-
./dotest.py provides a test driver which sets up the environment to run the
entire of part of the test suite . Example:
@@ -539,7 +535,9 @@ class Base(unittest2.TestCase):
Do current directory manipulation.
"""
# Fail fast if 'mydir' attribute is not overridden.
- if not cls.mydir or len(cls.mydir) == 0:
+ if not cls.mydir:
+ cls.mydir = Base.compute_mydir(sys.modules[cls.__module__].__file__)
+ if not cls.mydir:
raise Exception("Subclasses must override the 'mydir' attribute.")
# Save old working directory.
@@ -1703,11 +1701,6 @@ class TestBase(Base):
Important things for test class writers:
- - Overwrite the mydir class attribute, otherwise your test class won't
- run. It specifies the relative directory to the top level 'test' so
- the test harness can change to the correct working directory before
- running your test.
-
- The setUp method sets up things to facilitate subsequent interactions
with the debugger as part of the test. These include:
- populate the test method name