Commit Graph

15 Commits

Author SHA1 Message Date
Johnny Chen 74f26b8188 Changed TestBase.expect() to allow default 'msg' arg. Converted TestHelp.py.
llvm-svn: 111671
2010-08-20 19:17:39 +00:00
Johnny Chen b145bbaf4b Added more verbose output when string match fails. Converted TestGlobalVariables.py.
llvm-svn: 111666
2010-08-20 18:25:15 +00:00
Johnny Chen 5bbb88ff97 Added verbose option to runCmd()/expect() in lldbtest.py. Converted TestFunctionTypes.py.
llvm-svn: 111658
2010-08-20 17:57:32 +00:00
Johnny Chen 617cca957e Converted some more test cases to use runCmd()/expect().
llvm-svn: 111652
2010-08-20 17:04:20 +00:00
Johnny Chen a6480c124e Use cmd.startswith("run") instead of string equivalence test.
llvm-svn: 111587
2010-08-19 23:53:55 +00:00
Johnny Chen 27f212d1e6 Abstracted the running of command through the command interpreter and checking
its return status into lldbtest.TestBase.runCmd(); and runCmd() in combination
with checking the output against matching substrings (including startswith) into
lldbtest.TestBase.expect().

TestUnsignedTypes.py is refactored to use the abstracted APIs.  Other test cases
to be modified later.

llvm-svn: 111572
2010-08-19 23:26:59 +00:00
Johnny Chen e76896c987 Specify a more meaningful assert message for TestDeadStrip.py.
llvm-svn: 111294
2010-08-17 21:33:31 +00:00
Johnny Chen 6ca006c7c1 Factored the "continue" command execution of the inferior process as part of the
cleanup before finish into the test fixture in lldbtest.TestBase.tearDown().

Derivatives of TestBase is responsible for setting self.runStarted to True if an
inferior process has been started.

llvm-svn: 111188
2010-08-16 21:28:10 +00:00
Johnny Chen 1794184ada Modified the remaining test cases to display more meaningful assert messages.
Added a generic message generator to the lldbtest.py base module.

llvm-svn: 110625
2010-08-09 23:44:24 +00:00
Johnny Chen 0077809bc2 Added some commonly used assert messages to the lldbtest.py module which houses
the TestBase.  Modified TestArrayTypes.py to use the assert messages.  Other
files to follow.

llvm-svn: 110611
2010-08-09 22:01:17 +00:00
Johnny Chen 9289a65f75 Commented out "import traceback".
llvm-svn: 110497
2010-08-07 01:13:18 +00:00
Johnny Chen 73258830f3 o Added unittest2 which has added the new features in unittest for Python 2.7
backported to Python 2.3+.  Some of the features desired include better
  verbose reporting in unittest2.TextTestRunner and decorator support for
  skipping tests and expected failures.

  http://pypi.python.org/pypi/unittest2

o Modified the existing .py tests to use unittest2 and decorated
  TestSTL.test_step_into_stl(), which is known to always fail currently, with
  @unittest2.expectedFailure.

llvm-svn: 110397
2010-08-05 23:42:46 +00:00
Johnny Chen a21249597e When running a single test case, lldb.SBDebugger.Terminate() is not being called
because unittest.main() calls sys.exit() before returning.  Fixed by registering
an exit handler for this situation.

llvm-svn: 110379
2010-08-05 21:23:45 +00:00
Johnny Chen f02ec12796 Make it fail fast if 'mydir' attribute is not overridden by subclasses of
lldbtest.TestBase.

Also removed some debug prints.

llvm-svn: 107575
2010-07-03 20:41:42 +00:00
Johnny Chen bf6ffa3b89 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
2010-07-03 03:41:59 +00:00