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
f85b0b866c
Converted to use runCmd() and expect() for more abstraction.
...
llvm-svn: 111593
2010-08-20 00:27:37 +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
0c19186352
Added more informational assert message strings.
...
llvm-svn: 111536
2010-08-19 18:17:48 +00:00
Johnny Chen
5a2133909d
Simplify the assert matched-string criterion.
...
llvm-svn: 111429
2010-08-18 21:28:35 +00:00
Jim Ingham
ea480e507c
Added call stacks with inlined functions higher on the stack, and non-inlined functions at the bottom.
...
llvm-svn: 111379
2010-08-18 18:28:17 +00:00
Johnny Chen
83072afbcd
Write out the informational message about the total number of test cases to be
...
run to stderr, instead of stdout. The same as what the unittest framework uses.
llvm-svn: 111319
2010-08-17 23:00:13 +00:00
Johnny Chen
8a05de4d29
Add the ability to specify logging options for lldb and gdb-remote through two
...
additional env variables.
llvm-svn: 111295
2010-08-17 21:36:09 +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
46c2614b99
Added logging for process.gdb-remote by defining an environment variable named
...
GDB_REMOTE_LOG which specifies the log file pathname.
llvm-svn: 111198
2010-08-16 22:37:45 +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
dd63f5dbe1
Added a workaround for test suite hang while terminating by checking env variable
...
LLDB_TESTSUITE_FORCE_FINISH and, if defined, kill the test suite.
llvm-svn: 111056
2010-08-13 22:58:44 +00:00
Johnny Chen
f288803a95
Added a test case to exercise persistent variables in combination with the "expr" command.
...
llvm-svn: 111035
2010-08-13 20:12:05 +00:00
Jim Ingham
4512065130
Test files (but no test cases yet) for handling Universal files.
...
llvm-svn: 110893
2010-08-12 01:21:40 +00:00
Jim Ingham
b0be442408
Few little fixes to reading in inlined functions. Also added a test case with some inlining.
...
llvm-svn: 110892
2010-08-12 01:20:14 +00:00
Johnny Chen
edcbecfb1f
Call lldb.SBDebugger.Terminate() at the end of test suite run through the atexit
...
handler similar to what's happening for the individual test case run.
llvm-svn: 110719
2010-08-10 20:23:55 +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
f4804c696d
Install the SIGINT (control-c) handler before invoking the text test runner.
...
llvm-svn: 110595
2010-08-09 20:40:52 +00:00
Johnny Chen
9289a65f75
Commented out "import traceback".
...
llvm-svn: 110497
2010-08-07 01:13:18 +00:00
Johnny Chen
f5957e0603
Putting out messages about the number of test cases to be run before running the
...
whole test suite.
llvm-svn: 110487
2010-08-07 00:16:07 +00:00
Johnny Chen
ead526a056
Added more comments about unittest2.
...
llvm-svn: 110470
2010-08-06 21:07:38 +00:00
Johnny Chen
ae9fea401d
Added description about unittest2.
...
llvm-svn: 110400
2010-08-05 23:47:51 +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
fee57bb464
Added README file for the test suite.
...
llvm-svn: 110160
2010-08-03 22:12:11 +00:00
Greg Clayton
b0b9fe610a
Added support for objective C built-in types: id, Class, and SEL. This
...
involved watching for the objective C built-in types in DWARF and making sure
when we convert the DWARF types into clang types that we use the appropriate
ASTContext types.
Added a way to find and dump types in lldb (something equivalent to gdb's
"ptype" command):
image lookup --type <TYPENAME>
This only works for looking up types by name and won't work with variables.
It also currently dumps out verbose internal information. I will modify it
to dump more appropriate user level info in my next submission.
Hookup up the "FindTypes()" functions in the SymbolFile and SymbolVendor so
we can lookup types by name in one or more images.
Fixed "image lookup --address <ADDRESS>" to be able to correctly show all
symbol context information, but it will only show this extra information when
the new "--verbose" flag is used.
Updated to latest LLVM to get a few needed fixes.
llvm-svn: 110089
2010-08-03 00:35:52 +00:00
Johnny Chen
7f5f2809e8
Added comment.
...
llvm-svn: 110066
2010-08-02 21:26:00 +00:00
Johnny Chen
8402832e50
Cleanup of test case. Added more comments.
...
llvm-svn: 110064
2010-08-02 21:19:08 +00:00
Johnny Chen
7dc2e4784e
We can do better when reporting the status of one-liner script execution.
...
Change the prototype of ScriptInterpreter::ExecuteOneLine() to return bool
instead of void and take one additional parameter as CommandReturnObject *.
Propagate the status of one-liner execution back appropriately.
llvm-svn: 109899
2010-07-30 22:33:14 +00:00
Johnny Chen
b9e7c0aef6
Add a test case to test that lldb command "command source" works correctly.
...
llvm-svn: 109806
2010-07-29 21:42:28 +00:00
Johnny Chen
c0599ea1e7
Removed redundant import statement.
...
llvm-svn: 109803
2010-07-29 20:49:07 +00:00
Greg Clayton
2d5cdf0615
Added an objective C test case.
...
llvm-svn: 109798
2010-07-29 20:08:39 +00:00
Johnny Chen
ed4377eded
Removed debug stmts checked into the previous commit.
...
llvm-svn: 109712
2010-07-29 00:40:06 +00:00
Johnny Chen
588ddc1c58
Add some comment about possible related bug info.
...
llvm-svn: 109678
2010-07-28 22:00:42 +00:00
Johnny Chen
377a8ed913
Added a test case to test that we can successfully step into an STL function.
...
This test case currently always fails.
llvm-svn: 109674
2010-07-28 21:24:31 +00:00
Johnny Chen
571bfd6a2d
Added a test case to test that break on a struct declaration has no effect.
...
Instead, the first executable statement is set as the breakpoint.
llvm-svn: 109552
2010-07-27 22:48:46 +00:00
Johnny Chen
ef2f552de4
Added a test case for showing variables of unsigned types.
...
llvm-svn: 109545
2010-07-27 21:49:20 +00:00
Johnny Chen
3c39a980d7
Renaming from TestOrder.py to TestOrderFile.py.
...
llvm-svn: 109540
2010-07-27 21:03:55 +00:00
Johnny Chen
49583c207f
Fixed typos from cut-and-paste errors.
...
llvm-svn: 109539
2010-07-27 20:59:06 +00:00
Johnny Chen
364b0e72d1
Add a test case (incomplete) to check that settings and readings of program
...
variabes work.
llvm-svn: 107914
2010-07-08 21:38:07 +00:00
Johnny Chen
acfbeff17e
Test that debug symbols have the correct order as specified by the order file.
...
llvm-svn: 107844
2010-07-08 00:17:29 +00:00
Johnny Chen
529728e82a
Fixed typos in the comments.
...
llvm-svn: 107829
2010-07-07 22:49:43 +00:00
Johnny Chen
41a3c9a5f8
Test that breakpoint by symbol name works correctly dlopen'ing a dynamic lib.
...
llvm-svn: 107812
2010-07-07 21:10:55 +00:00
Johnny Chen
51991b549b
Enable a test clause since rdar://problem/8163668 is fixed by http://llvm.org/viewvc/llvm-project?rev=107729&view=rev .
...
llvm-svn: 107733
2010-07-06 23:41:17 +00:00
Johnny Chen
f031b71f7e
if -1 => evaluates to True
...
oops!
llvm-svn: 107724
2010-07-06 23:26:16 +00:00
Johnny Chen
0e38f42f0a
Test that breakpoint works correctly in the presence of dead-code stripping.
...
llvm-svn: 107719
2010-07-06 22:52:00 +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
Johnny Chen
f1d2ac7c01
Test variable with function ptr type and that break on the function works.
...
llvm-svn: 107545
2010-07-02 23:50:37 +00:00
Johnny Chen
03813ec687
Also verified the values of global variables.
...
llvm-svn: 107525
2010-07-02 22:12:25 +00:00
Johnny Chen
85d6948f3d
Add a test to show global variables and to verify that they do display as having
...
global scopes.
llvm-svn: 107522
2010-07-02 22:04:42 +00:00
Johnny Chen
c653d4c574
Fixed logic error; checking return status and raising exception should only be
...
done if the environment variable LLDB_LOG is defined.
llvm-svn: 107508
2010-07-02 20:35:23 +00:00
Johnny Chen
3d7e687245
A dumber way to invoke the test suite.
...
Use this script to visit each python test case under the specified directory and
run python unittest.main() on each test case.
llvm-svn: 107447
2010-07-01 23:01:23 +00:00
Johnny Chen
119b53ea6d
Turn on logging for debugging purposes if ${LLDB_LOG} environment variable is
...
is defined. Use ${LLDB_LOG} to specify the log file.
Create a singleton SBDebugger in the lldb namespace, that gets used when running
the entire test suite.
llvm-svn: 107445
2010-07-01 22:52:57 +00:00
Johnny Chen
79046273dd
Removed most of the time delay introduced in the test scripts.
...
Left some and added some print statements for debugging purpose.
llvm-svn: 107386
2010-07-01 05:31:44 +00:00
Johnny Chen
8c3f9187f9
Added some delay (100 ms) after executing each 'command interpreter' command;
...
this seems to alleviate the intermittent failure observed while running the
whole test suite.
llvm-svn: 107357
2010-07-01 00:18:39 +00:00
Johnny Chen
41a2ad5f85
Added comments.
...
llvm-svn: 107333
2010-06-30 22:22:37 +00:00
Johnny Chen
6ea3fc5a9f
Added TestClassTypes.py to test setting a breakpoint on a class constructor and
...
do 'variable list this' command when stopped.
Applied some cleanup on TestArrayTypes.py. In particular, specify the absolute
path to the object file in order not to confuse the debugger.
llvm-svn: 107330
2010-06-30 22:16:25 +00:00
Johnny Chen
20faefd329
Fixed a typo.
...
llvm-svn: 107318
2010-06-30 20:43:35 +00:00
Johnny Chen
94a6899e23
Add some delay before calling SBDebugger.Terminate().
...
llvm-svn: 107221
2010-06-29 23:17:15 +00:00
Johnny Chen
cb9b857959
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
2010-06-29 23:10:39 +00:00
Johnny Chen
4657be6e63
For the time being, let's bracket the test runner within the
...
lldb.SBDebugger.Initialize()/Terminate() pair.
Change TestHelp.py to use synchronous debugging, which is easier to work with.
llvm-svn: 107198
2010-06-29 19:44:16 +00:00
Johnny Chen
7e363f5571
Added test for a previously fixed bug where invoking lldb command from an emacs
...
shell and issuing 'help' would hang (was actually infinitely looping).
llvm-svn: 107066
2010-06-28 20:55:57 +00:00
Johnny Chen
c43d789a38
No need to add the test script containing directory to sys.path more than once.
...
llvm-svn: 106929
2010-06-26 00:19:32 +00:00
Johnny Chen
6d436d63ff
Removed debug print statements.
...
llvm-svn: 106913
2010-06-25 23:34:17 +00:00
Johnny Chen
f94c8c2bf9
Use lldb.SBDebugger.Create() factory method to create an instance first.
...
llvm-svn: 106910
2010-06-25 23:22:48 +00:00
Johnny Chen
9320d4ab60
A simple test of 'help' command and its output.
...
llvm-svn: 106909
2010-06-25 23:15:47 +00:00
Johnny Chen
a765c28db3
A simple testing framework for lldb using python's unit testing framework.
...
Tests for lldb are written as python scripts which take advantage of the script
bridging provided by LLDB.framework to interact with lldb core.
A specific naming pattern is followed by the .py script to be recognized as
a module which implements a test scenario, namely, Test*.py.
To specify the directories where "Test*.py" python test scripts are located,
you need to pass in a list of directory names. By default, the current
working directory is searched if nothing is specified on the command line.
An example:
[14:10:20] johnny:/Volumes/data/lldb/svn/trunk/test $ ./dotest.py -v example
test_choice (TestSequenceFunctions.TestSequenceFunctions) ... ok
test_sample (TestSequenceFunctions.TestSequenceFunctions) ... ok
test_shuffle (TestSequenceFunctions.TestSequenceFunctions) ... ok
----------------------------------------------------------------------
Ran 3 tests in 0.000s
OK
llvm-svn: 106890
2010-06-25 21:14:08 +00:00
Johnny Chen
7c3f7fee41
Left a debug statement in the previous checkin.
...
llvm-svn: 106510
2010-06-22 00:13:20 +00:00
Johnny Chen
a02199f5e7
Remove stale reference to the lldb path component.
...
llvm-svn: 106509
2010-06-22 00:11:26 +00:00
Chris Lattner
30fdc8d841
Initial checkin of lldb code from internal Apple repo.
...
llvm-svn: 105619
2010-06-08 16:52:24 +00:00