Commit Graph

10 Commits

Author SHA1 Message Date
Johnny Chen 0f2ed0e5df Make the assignment of TestBase.mydir more portable.
llvm-svn: 140640
2011-09-27 21:49:34 +00:00
Greg Clayton fe42ac4d0a Cleaned up the SBType.h file to not include internal headers and reorganized
the SBType implementation classes.

Fixed LLDB core and the test suite to not use deprecated SBValue APIs.

Added a few new APIs to SBValue:

    int64_t
    SBValue::GetValueAsSigned(int64_t fail_value=0);

    uint64_t
    SBValue::GetValueAsUnsigned(uint64_t fail_value=0)

 

llvm-svn: 136829
2011-08-03 22:57:10 +00:00
Johnny Chen 5ccbccfce0 Add a @benchmarks_test decorator for test method we want to categorize as benchmarks test.
The test driver now takes an option "+b" which enables to run just the benchmarks tests.
By default, tests decorated with the @benchmarks_test decorator do not get run.

Add an example benchmarks test directory which contains nothing for the time being,
just to demonstrate the @benchmarks_test concept.

For example,

$ ./dotest.py -v benchmarks

...

----------------------------------------------------------------------
Collected 2 tests

1: test_with_gdb (TestRepeatedExprs.RepeatedExprssCase)
   Test repeated expressions with gdb. ... skipped 'benchmarks tests'
2: test_with_lldb (TestRepeatedExprs.RepeatedExprssCase)
   Test repeated expressions with lldb. ... skipped 'benchmarks tests'

----------------------------------------------------------------------
Ran 2 tests in 0.047s

OK (skipped=2)
$ ./dotest.py -v +b benchmarks

...

----------------------------------------------------------------------
Collected 2 tests

1: test_with_gdb (TestRepeatedExprs.RepeatedExprssCase)
   Test repeated expressions with gdb. ... running test_with_gdb
benchmarks result for test_with_gdb
ok
2: test_with_lldb (TestRepeatedExprs.RepeatedExprssCase)
   Test repeated expressions with lldb. ... running test_with_lldb
benchmarks result for test_with_lldb
ok

----------------------------------------------------------------------
Ran 2 tests in 0.270s

OK

Also mark some Python API tests which are missing the @python_api_test decorator.

llvm-svn: 136553
2011-07-30 01:39:58 +00:00
Johnny Chen b3f07c1959 Minor change of variable name, from m to b (for breakpoint).
llvm-svn: 135214
2011-07-14 23:33:34 +00:00
Johnny Chen 1d3e880c2c Passing in os.ctermid() as the arg for SBTarget.Launch(...) for stdin_path, stdout_path, and stderr_path
is just wrong and resulted in the inferior's output getting mixed into the GDB remote communication's
log file.  Change all test cases to not pass os.ctermid() and either use SBTarget.LaunchSimple() or
SBTarget.Launch() and pass None as stdin_path/stdout_path/srderr_path to use a pseudo terminal.

rdar://problem/9716499 program output is getting mixed into the GDB remote communications

llvm-svn: 134940
2011-07-11 23:38:23 +00:00
Johnny Chen 5a0bee7c5f The extra burden for the Python API test case to assign its process object to self.process
in order to have its process cleaned up (terminated) upon tearDown is gone for good.
Let's simplify a bunch of Python API test cases.

llvm-svn: 133097
2011-06-15 22:14:12 +00:00
Johnny Chen 112f5696fb Add truth value testing to those lldb Python objects with the IsValid() method definitions.
object.__nonzero__(self) is called to implement truth value testing and the built-in operation bool(),
via a simple delegation to self.IsValid().

Change tests under python_api/lldbutil to utilize this mechanism.

llvm-svn: 131494
2011-05-17 22:14:39 +00:00
Johnny Chen fac7b3aae6 Add implementation of built-in function len() for those lldb containers with
unambiguous iteration support.  So that we could, for example:

    ...

    REGs = lldbutil.get_GPRs(frame)
    print "Number of general purpose registers: %d" % len(REGs)
    for reg in REGs:
        print "%s => %s" %(reg.GetName(), reg.GetValue())

    ...

llvm-svn: 131418
2011-05-16 20:31:18 +00:00
Johnny Chen 29fd504c09 Renamed the test cases more properly to test_lldb_iter_module/breakpoint/farme.
llvm-svn: 131412
2011-05-16 18:30:00 +00:00
Johnny Chen ad7372c538 Add two utility functions:
o get_parent_frame(frame)
    o get_args_as_string(frame)

to lldbutil.py and create TestFrameUtils.py to exercise the utils.
Plus re-arrange the test/python_api/lldbutil to have three directories
for testing iteration, process stack traces, and the just added frame utils.

llvm-svn: 131213
2011-05-12 00:32:41 +00:00