diff options
| author | Johnny Chen <johnny.chen@apple.com> | 2010-06-29 23:10:39 +0000 |
|---|---|---|
| committer | Johnny Chen <johnny.chen@apple.com> | 2010-06-29 23:10:39 +0000 |
| commit | cb9b85795962ffda9f9fa3f50db64304915d4700 (patch) | |
| tree | 144fdcfa000e05b547e373630d50928a7a451df6 /lldb/test/help/TestHelp.py | |
| parent | 74d28bd084a29eac89aa16ed452582df91cfa1fd (diff) | |
| download | bcm5719-llvm-cb9b85795962ffda9f9fa3f50db64304915d4700.tar.gz bcm5719-llvm-cb9b85795962ffda9f9fa3f50db64304915d4700.zip | |
Added TestArrayTypes.py for test/array_types directory.
Also modified dotest.py so that it sets the LLDB_TEST environment variable
so that individual test cases can locate their supporting files correctly.
llvm-svn: 107220
Diffstat (limited to 'lldb/test/help/TestHelp.py')
| -rw-r--r-- | lldb/test/help/TestHelp.py | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/lldb/test/help/TestHelp.py b/lldb/test/help/TestHelp.py index 5b006efab8b..56ec504ff65 100644 --- a/lldb/test/help/TestHelp.py +++ b/lldb/test/help/TestHelp.py @@ -1,19 +1,26 @@ """Test lldb help command.""" +import os import lldb import unittest class TestHelpCommand(unittest.TestCase): def setUp(self): - self.debugger = lldb.SBDebugger.Create() - self.debugger.SetAsync(False) - self.ci = self.debugger.GetCommandInterpreter() + # 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() + self.dbg.SetAsync(False) + self.ci = self.dbg.GetCommandInterpreter() if not self.ci: raise Exception('Could not get the command interpreter') def tearDown(self): - pass + # Restore old working directory. + os.chdir(self.oldcwd) def test_simplehelp(self): """A simple test of 'help' command and its output.""" @@ -22,7 +29,6 @@ class TestHelpCommand(unittest.TestCase): self.assertTrue(res.Succeeded()) self.assertTrue(res.GetOutput().startswith( 'The following is a list of built-in, permanent debugger commands')) - #print res.GetOutput() def test_help_should_not_hang_emacsshell(self): """'set term-width 0' should not hang the help command.""" @@ -33,7 +39,6 @@ class TestHelpCommand(unittest.TestCase): self.assertTrue(res.Succeeded()) self.assertTrue(res.GetOutput().startswith( 'The following is a list of built-in, permanent debugger commands')) - #print res.GetOutput() if __name__ == '__main__': |

