Commit Graph

114 Commits

Author SHA1 Message Date
Johnny Chen
11c34a0488 Converted TestDeadStrip.py to Dsym/Dwarf combination.
llvm-svn: 112670
2010-08-31 23:12:15 +00:00
Johnny Chen
9129998061 Converted TestClassTypes.py to Dsym/Dwarf combination. Marked one test case as
expectedFailure because in dwarf format, "variable list this" returns an error.

llvm-svn: 112660
2010-08-31 22:26:16 +00:00
Johnny Chen
65a6524d00 Converted TestBitfields.py to Dsym/Dwarf combination.
llvm-svn: 112646
2010-08-31 21:49:24 +00:00
Johnny Chen
517210b0f3 Updated to reflect the "plugins" directory.
llvm-svn: 112607
2010-08-31 17:51:08 +00:00
Johnny Chen
8d55a34a34 Changed the buildDsym()/buildDwarf() TestBase methods to use a plugin framework
to delegate the building of binaries to a sys.platform-sepcific plugin.

Modified the dotest.py test driver to add the "plugins" directory to the
PYTHONPATH as well.

darwin.py is the Mac OS X plugin module.

llvm-svn: 112606
2010-08-31 17:42:54 +00:00
Johnny Chen
324355b9a1 Added doc strings to the array_types test cases. And terminate the current
process being debugged in the TestBase.tearDown() instead of letting it continue
and finish.

llvm-svn: 112556
2010-08-30 23:44:39 +00:00
Johnny Chen
a33a93cbde Converted TestArrayTypes.py to Dsym/Dwarf combination, and added verbose output
of os command to lldbtest.TestBase.system() method.

llvm-svn: 112547
2010-08-30 23:08:52 +00:00
Johnny Chen
2f1ad5e2bd Added buildDsym() and buildDwarf() methods to lldbtest.TestBase class, and call
them from test cases instead of issuing "make clean; make ..." os command.

llvm-svn: 112542
2010-08-30 22:26:48 +00:00
Johnny Chen
8952a2d5b6 Added a system() method to the TestBase class of lldbtest.py, which is actually
taken from Python 2.7's subprocess.check_output() convenience function.  The
purpose of this method is to run the os command with arguments and return its
output as a byte string.

Modified hello_world/TestHelloWorld.py to have two test cases:

o test_with_dsym_and_run_command
o test_with_dwarf_and_process_launch_api

with the dsym case conditioned on sys.platform.startswith("darwin") being true.
The two cases utilize the system() method to invoke "make clean; make MAKE_DYSM=YES/NO"
to prepare for the appropriate debugging format before running the test logic.

llvm-svn: 112530
2010-08-30 21:35:00 +00:00
Johnny Chen
269457515a Fail early, fail fast.
llvm-svn: 112328
2010-08-27 23:53:00 +00:00
Johnny Chen
5ee881948a Added a test case test_breakpoint_creation_by_filespec_python() which creates a
breakpoint by FileSpec and line number and exercises some FileSpec APIs.

Also, RUN_STOPPED is a bad assert name, RUN_SUCCEEDED is better.

llvm-svn: 112327
2010-08-27 23:47:36 +00:00
Johnny Chen
fd8967a82f Fixed a typo in the method name.
llvm-svn: 112311
2010-08-27 22:39:49 +00:00
Johnny Chen
ccd570da6b Trivial doc string mod.
llvm-svn: 112293
2010-08-27 21:15:57 +00:00
Johnny Chen
82d404c886 Added TestHelloWorld.py which exercises the Python APIs for target, breakpoint,
and process.  Added comment within the file about issues of using LaunchProcess
of SBTarget to launch a process (rdar://problem/8364687).

llvm-svn: 112276
2010-08-27 18:08:58 +00:00
Johnny Chen
827edffafd Added a test case to bitfields which uses the Python APIs from lldb.py.
Added a utility method to TestBase class to debug print an SBValue object.

llvm-svn: 112247
2010-08-27 00:15:48 +00:00
Johnny Chen
c19e3a0946 Modified method doc string for verbose test description output.
llvm-svn: 112236
2010-08-26 22:38:51 +00:00
Johnny Chen
bf325e4a37 Changed from dbg.GetCurrentTarget() to dbg.GetSelectedTarget().
llvm-svn: 112231
2010-08-26 22:06:03 +00:00
Johnny Chen
2771d7bf49 Added comment about target.LaunchProcess() not working.
llvm-svn: 112226
2010-08-26 21:53:26 +00:00
Johnny Chen
27c412320e Added a utility function EnvArray() to lldbtest.py.
llvm-svn: 112223
2010-08-26 21:49:29 +00:00
Johnny Chen
5fca8ca8cd o Added a test case for array_types which uses the Python APIs from lldb.py,
with the only exception of launching the process from SBTarget which is under
  investigation.

o build-swig-Python.sh should also checks the timestamp of ${swig_input_file}
  for update eligibility.  Also, once an update is in order, there's no need
  to check the remaining header files for timestamps.

o Coaches swig to treat StopReason as an int type, instead of a C++ class.

llvm-svn: 112210
2010-08-26 20:04:17 +00:00
Johnny Chen
61703c96f2 Minor doc string modification.
llvm-svn: 112103
2010-08-25 22:56:10 +00:00
Johnny Chen
f3c59231b3 Added logic to TestUniversal.py to exercise the python APIs:
o SBDebugger.GetCurrentTarget()
o SBTarget.GetProcess()
o SBProcess.GetAddressByteSize()

in order to make sure that, indeed, 64-bit, followed by 32-bit processes have
been launched.

Added invoke() method to TestBase to factor in the tracing logic in one place.
This method allows an object to call a method with no arg reflectively.

llvm-svn: 112102
2010-08-25 22:52:45 +00:00
Johnny Chen
981463d670 Fixed a logic error in the expect() method. If the start string does not match,
there's no point matching further sub strings; the expect() already fails.

Also cleaned up the assert message for VARIABLES_DISPLAYED_CORRECTLY.

llvm-svn: 112074
2010-08-25 19:00:04 +00:00
Johnny Chen
f2b70237e6 Allow command retries in case of process launch failures. This recovery
mechanism seems to work fine on my MacBook Pro in some limited test cases.

The default maxLaunchCount and timeWait variables used in the scheme can be
overridden by the env variables LLDB_MAX_LAUNCH_COUNT and LLDB_TIME_WAIT.

llvm-svn: 112071
2010-08-25 18:49:48 +00:00
Johnny Chen
c7c9fcfbd6 More descriptive trace messages for the matchings of start and sub strings.
llvm-svn: 112000
2010-08-24 23:48:10 +00:00
Johnny Chen
536b7d2d26 Removed the @unitest2.expectedFailure decorator. The i386 process launch works
correctly after all.  It was my own configuration error (I was building x86_64
only).

llvm-svn: 111992
2010-08-24 23:14:47 +00:00
Johnny Chen
3c884a014c Added a test for launching a universal binary. Launch of i386 architecture
currently fails: rdar://problem/8349784.

Forgot to check in lldbtest.py in the previous commit r111958.

llvm-svn: 111975
2010-08-24 22:07:56 +00:00
Johnny Chen
9c194e3e75 Converted to Makefile.rules.
llvm-svn: 111961
2010-08-24 20:54:26 +00:00
Johnny Chen
9d2bd8301d More descriptive method doc string.
llvm-svn: 111960
2010-08-24 20:48:28 +00:00
Johnny Chen
6b900c5dcd Added a test case which uses "image lookup" command on an enum data type.
llvm-svn: 111958
2010-08-24 20:44:33 +00:00
Johnny Chen
f2b1419acc Need a better method name.
llvm-svn: 111939
2010-08-24 18:46:00 +00:00
Johnny Chen
f0dec3cf31 Converted to Makefile.rules.
llvm-svn: 111938
2010-08-24 18:41:52 +00:00
Johnny Chen
ea920fe8b4 Added test case TestBitfields.py for rdar://problem/8348251, where
"variable list bits" display bits variable correctly, but not "variable list".

llvm-svn: 111937
2010-08-24 18:21:23 +00:00
Johnny Chen
734cdb58f1 Converted to Makefile.rules.
llvm-svn: 111928
2010-08-24 17:43:34 +00:00
Johnny Chen
e3dc0f048a Generates the .d prerequisite file for dylib as well.
llvm-svn: 111920
2010-08-24 16:35:00 +00:00
Johnny Chen
9bc867aaf5 Makefile refactoring for the test suite. Added a make directory under test,
which hosts the Makefile.rules and modified most of the Makefiles under each
test case directories to utilize Mekefile.rules.

Added a description of 'make' directory into README-TestSuite file.

llvm-svn: 111868
2010-08-23 23:56:08 +00:00
Johnny Chen
d0190a6182 Changed the keyword argument for runCmd()/expect() from 'verbose' to 'trace',
which, defaults to False, and if set to True, will trace lldb command execution
and result.

Added "-t" command option to the test driver dotest.py which sets the
LLDB_COMMAND_TRACE environment variable to "YES" and as a result always turns on
command tracing regardless of the 'trace' keyword argument to runCmd()/expect().

llvm-svn: 111811
2010-08-23 17:10:44 +00:00
Johnny Chen
ff3d01d0b7 Print the verbose output of runCmd()/expect() to stderr instead of stdout.
And converted the rest of the test cases to runCmd()/expect().

llvm-svn: 111677
2010-08-20 21:03:09 +00:00
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