diff options
author | Johnny Chen <johnny.chen@apple.com> | 2010-07-03 03:41:59 +0000 |
---|---|---|
committer | Johnny Chen <johnny.chen@apple.com> | 2010-07-03 03:41:59 +0000 |
commit | bf6ffa3b894c99c169432b759e50ce91bd746e6f (patch) | |
tree | 57a43829d0278f016a6e3d9143da9238b34ea968 /lldb/test/help/TestHelp.py | |
parent | df44f74290be85d9b5be22516c51ee513982c51e (diff) | |
download | llvm-bf6ffa3b894c99c169432b759e50ce91bd746e6f.zip llvm-bf6ffa3b894c99c169432b759e50ce91bd746e6f.tar.gz llvm-bf6ffa3b894c99c169432b759e50ce91bd746e6f.tar.bz2 |
Abstracted the lldb-specific unittest.TestCase.setUp()/tearDown() in a separate
module lldbtest.py and refactored the existing test cases to derive from the
abstract base class lldbtest.TestBase.
MOdified the test driver (dotest.py and dotest.pl) to set up additional
PYTHONPATH component for locating the lldbtest module, which sits in the same
directory.
llvm-svn: 107563
Diffstat (limited to 'lldb/test/help/TestHelp.py')
-rw-r--r-- | lldb/test/help/TestHelp.py | 29 |
1 files changed, 4 insertions, 25 deletions
diff --git a/lldb/test/help/TestHelp.py b/lldb/test/help/TestHelp.py index 0cf7ddb..530bbda 100644 --- a/lldb/test/help/TestHelp.py +++ b/lldb/test/help/TestHelp.py @@ -1,33 +1,13 @@ """Test lldb help command.""" import os, time -import lldb import unittest +import lldb +import lldbtest -main = False - -class TestHelpCommand(unittest.TestCase): - - def setUp(self): - global main - - # Save old working directory. - self.oldcwd = os.getcwd() - # Change current working directory if ${LLDB_TEST} is defined. - if ("LLDB_TEST" in os.environ): - os.chdir(os.path.join(os.environ["LLDB_TEST"], "help")); - self.dbg = lldb.SBDebugger.Create() if main else lldb.DBG - if not self.dbg.IsValid(): - raise Exception('Invalid debugger instance') - self.dbg.SetAsync(False) - self.ci = self.dbg.GetCommandInterpreter() - if not self.ci: - raise Exception('Could not get the command interpreter') +class TestHelpCommand(lldbtest.TestBase): - def tearDown(self): - # Restore old working directory. - os.chdir(self.oldcwd) - del self.dbg + mydir = "help" def test_simplehelp(self): """A simple test of 'help' command and its output.""" @@ -53,6 +33,5 @@ class TestHelpCommand(unittest.TestCase): if __name__ == '__main__': lldb.SBDebugger.Initialize() - main = True unittest.main() lldb.SBDebugger.Terminate() |