summaryrefslogtreecommitdiffstats
path: root/lldb/test/lldbtest.py
Commit message (Collapse)AuthorAgeFilesLines
...
* Decorate the two test cases in TestReturnValue.py as i386 only ↵Johnny Chen2011-12-221-0/+21
| | | | | | expectedFailure, aka @expectedFailurei386. llvm-svn: 147177
* Let's also record the compiler version used for compiling the inferior into ↵Johnny Chen2011-12-031-0/+3
| | | | | | the session info llvm-svn: 145732
* Add an option '-S' to skip the build and cleanup while running the test.Johnny Chen2011-11-171-8/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use this option with care as you would need to build the inferior(s) by hand and build the executable(s) with the correct name(s). This option can be used with '-# n' to stress test certain test cases for n number of times. An example: [11:55:11] johnny:/Volumes/data/lldb/svn/trunk/test/python_api/value $ ls Makefile TestValueAPI.pyc linked_list TestValueAPI.py change_values main.c [11:55:14] johnny:/Volumes/data/lldb/svn/trunk/test/python_api/value $ make EXE=test_with_dsym clang -gdwarf-2 -O0 -arch x86_64 -c -o main.o main.c clang -gdwarf-2 -O0 -arch x86_64 main.o -o "test_with_dsym" /usr/bin/dsymutil -o "test_with_dsym.dSYM" "test_with_dsym" [11:55:20] johnny:/Volumes/data/lldb/svn/trunk/test/python_api/value $ cd ../.. [11:55:24] johnny:/Volumes/data/lldb/svn/trunk/test $ ./dotest.py -v -# 10 -S -f ValueAPITestCase.test_with_dsym LLDB build dir: /Volumes/data/lldb/svn/trunk/build/Debug LLDB-89 Path: /Volumes/data/lldb/svn/trunk URL: https://johnny@llvm.org/svn/llvm-project/lldb/trunk Repository Root: https://johnny@llvm.org/svn/llvm-project Repository UUID: 91177308-0d34-0410-b5e6-96231b3b80d8 Revision: 144914 Node Kind: directory Schedule: normal Last Changed Author: gclayton Last Changed Rev: 144911 Last Changed Date: 2011-11-17 09:22:31 -0800 (Thu, 17 Nov 2011) Session logs for test failures/errors/unexpected successes will go into directory '2011-11-17-11_55_29' Command invoked: python ./dotest.py -v -# 10 -S -f ValueAPITestCase.test_with_dsym ---------------------------------------------------------------------- Collected 1 test 1: test_with_dsym (TestValueAPI.ValueAPITestCase) Exercise some SBValue APIs. ... ok ---------------------------------------------------------------------- Ran 1 test in 1.163s OK 1: test_with_dsym (TestValueAPI.ValueAPITestCase) Exercise some SBValue APIs. ... ok ---------------------------------------------------------------------- Ran 1 test in 0.200s OK 1: test_with_dsym (TestValueAPI.ValueAPITestCase) Exercise some SBValue APIs. ... ok ---------------------------------------------------------------------- Ran 1 test in 0.198s OK 1: test_with_dsym (TestValueAPI.ValueAPITestCase) Exercise some SBValue APIs. ... ok ---------------------------------------------------------------------- Ran 1 test in 0.199s OK 1: test_with_dsym (TestValueAPI.ValueAPITestCase) Exercise some SBValue APIs. ... ok ---------------------------------------------------------------------- Ran 1 test in 0.239s OK 1: test_with_dsym (TestValueAPI.ValueAPITestCase) Exercise some SBValue APIs. ... ok ---------------------------------------------------------------------- Ran 1 test in 1.215s OK 1: test_with_dsym (TestValueAPI.ValueAPITestCase) Exercise some SBValue APIs. ... ok ---------------------------------------------------------------------- Ran 1 test in 0.105s OK 1: test_with_dsym (TestValueAPI.ValueAPITestCase) Exercise some SBValue APIs. ... ok ---------------------------------------------------------------------- Ran 1 test in 0.098s OK 1: test_with_dsym (TestValueAPI.ValueAPITestCase) Exercise some SBValue APIs. ... ok ---------------------------------------------------------------------- Ran 1 test in 0.195s OK 1: test_with_dsym (TestValueAPI.ValueAPITestCase) Exercise some SBValue APIs. ... ok ---------------------------------------------------------------------- Ran 1 test in 1.197s OK [11:55:34] johnny:/Volumes/data/lldb/svn/trunk/test $ llvm-svn: 144919
* Docstring clarification.Johnny Chen2011-11-161-1/+1
| | | | llvm-svn: 144848
* Also dump the pid of the process launching through the ↵Johnny Chen2011-11-161-0/+2
| | | | | | | | lldbtest.system(*popenargs, **kwargs) API. This helps track down possible zombie processes. llvm-svn: 144846
* Modify lldbtest.Base.runHooks() to now take the following keyword arguments:Johnny Chen2011-10-191-4/+14
| | | | | | | | | | | | child=None, child_prompt=None, use_cmd_api=False By default, expect a pexpect spawned child and child prompt to be supplied (use_cmd_api=False). If use_cmd_api is true, ignore the child and child prompt and use self.runCmd() to run the hooks one by one. Modify existing client to reflect the change. llvm-svn: 142532
* Extract the run hooks functionality into the base class lldbtest.Base.Johnny Chen2011-10-191-0/+14
| | | | llvm-svn: 142469
* If we spawn an lldb process for test (via pexpect), do not load the init ↵Johnny Chen2011-10-071-0/+6
| | | | | | | | | file unless told otherwise. Set up self.lldbOption to be "--no-lldbibit" unless env variable NO_LLDBIBIT is defined and equals "NO". Also add "-nx" to gdb spawned. llvm-svn: 141384
* o lldbtest.py:Johnny Chen2011-09-301-9/+33
| | | | | | | | | | | | | | | Add a keyword argument 'endstr' to TestBase.expect() method to assert that the output will end with 'endstr'. Add TestBase.switch_to_thread_with_stop_reason(stop_reason) to select the thread with the stop reason = 'stop_reason' as the current thread. o TestWatchLocation.py: Modified to switch to the stopped thread with stop reason = watchpoint and to evaluate an expression with expected output for stronger assertion. llvm-svn: 140890
* Add a simple watchpoint test to exercise watchpoint creation followed by ↵Johnny Chen2011-09-151-0/+3
| | | | | | watchpoint hit events. llvm-svn: 139847
* Add a new attribute self.lldbHere, representing the fullpath to the 'lldb' ↵Johnny Chen2011-08-261-0/+6
| | | | | | | | | | | | | | | | executable built locally from the source tree. This is distinguished from self.lldbExec, which can be used by test/benchmarks to measure the performances against other debuggers. You can use environment variable LLDB_EXEC to specify self.lldbExec to the dotest.py test driver, otherwise it is going to be populated with self.lldbHere. Modify the regular tests under test dir, i.e., not test/benchmarks, to use self.lldbHere. Also modify the benchmarks tests to use self.lldbHere when it needs an 'lldb' executable with debug info to do the performance measurements. llvm-svn: 138608
* Pretty print the run options for dumpSessionInfo(self) client.Johnny Chen2011-08-241-4/+6
| | | | llvm-svn: 138466
* Minor change for the @expectedFailureClang logic. For the non-clang test ↵Johnny Chen2011-08-191-2/+2
| | | | | | | | failure, re-raise the exception to get more stack trace information. llvm-svn: 138021
* Add a decorator for marking clang only expectedFailure. Use it for the ↵Johnny Chen2011-08-191-1/+21
| | | | | | | | | | | | | | | | | | | | test_step_over_3_times_with_dsym/dwarf() test cases in TestThreadAPI.py by decorating it with @expectedFailureClang. Example: @expectedFailureClang @python_api_test def test_step_over_3_times_with_dwarf(self): """Test Python SBThread.StepOver() API.""" # We build a different executable than the default buildDwarf() does. d = {'CXX_SOURCES': 'main2.cpp', 'EXE': self.exe_name} self.buildDwarf(dictionary=d) self.setTearDownCleanup(dictionary=d) self.step_over_3_times(self.exe_name) llvm-svn: 138019
* Add comment about recent change.Johnny Chen2011-08-161-0/+2
| | | | llvm-svn: 137776
* Fix the test suite error of:Johnny Chen2011-08-161-1/+1
| | | | | | | | | | ... File "/Volumes/data/lldb/svn/trunk/test/lldbtest.py", line 243, in __init__ self.session = test.session if test else None AttributeError: 'StdCXXDisassembleTestCase' object has no attribute 'session' llvm-svn: 137724
* Forgot to initialize the self.__skipped__ attribute lldbtest.Base.Johnny Chen2011-08-161-0/+2
| | | | llvm-svn: 137696
* Test driver should also report skipped tests because there were cases when ↵Johnny Chen2011-08-151-1/+12
| | | | | | | | tests were skipped due to incorrect skip-logic. llvm-svn: 137678
* Add TestInferiorChanged.py to test that lldb reloads the inferior after it ↵Johnny Chen2011-08-121-0/+6
| | | | | | | | | | | was changed during the debug session. First, main.c causes a crash, the inferior then gets re-built with main2.c which is not crashing. Add Base.cleanup(self, dictionary=None) for platform specfic way to do cleanup after build. This plugin method is used by the above test case to cleanup the main.c build before rebuild for main2.c. llvm-svn: 137500
* When a benchmarks test fails, the re-run command should include the '+b' ↵Johnny Chen2011-08-111-1/+8
| | | | | | option instead of the '-t' option. llvm-svn: 137285
* o modify-python-lldb.py:Johnny Chen2011-08-051-0/+11
| | | | | | | | | | | | | | | Add the rich comparison methods (__eq__, __ne__) to SBType, too. o lldbtest.py: Add debug utility method TestBase.DebugSBType(). o test/python_api/type: Add tests for exercising SBType/SBTypeList API, including the SBTarget.FindTypes(type_name) API which returns a SBTypeList matching the type_name. llvm-svn: 136975
* Add the real benchmarks comparing lldb against gdb for repeated expression ↵Johnny Chen2011-08-021-3/+3
| | | | | | | | | | | | | | | | | | | evaluations. Modify lldbbench.py so that lldbtest.line_number() utility function is available to BenchBase client as just line_number(), and modify lldbtest.py so that self.lldbExec (the full path for the 'lldb' executable) is available to BenchBase client as well. An example run of the test case on my MacBook Pro running Lion: 1: test_compare_lldb_to_gdb (TestRepeatedExprs.RepeatedExprsCase) Test repeated expressions with lldb vs. gdb. ... lldb_avg: 0.204339 gdb_avg: 0.205721 lldb_avg/gdb_avg: 0.993284 ok llvm-svn: 136740
* Add an abstract base class called BenchBase to be inherited by benchmark tests.Johnny Chen2011-08-011-32/+33
| | | | | | Modify the example TestRepeatedExprs.py to use BenchBase, instead. llvm-svn: 136649
* More refactorings to migrate logic from TestBase to its parent class.Johnny Chen2011-08-011-240/+258
| | | | llvm-svn: 136641
* Start refactoring lldbtest.TestBase so that it inherits from a newly created ↵Johnny Chen2011-08-011-127/+148
| | | | | | | | | | lldbtest.Base class, while its API clients remain unchanged. The new lldbtest.Base class is to capture common behaviors when working with the test driver to accomplish things. The clients of lldbtest.Base can be lldb command line and api tests as well as other generic tests like a benchmark test. llvm-svn: 136636
* Add a @benchmarks_test decorator for test method we want to categorize as ↵Johnny Chen2011-07-301-2/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Add TestValueAPI.py to exercise the newly added/modified SBValue APIs:Johnny Chen2011-07-151-0/+2
| | | | | | | o GetChildAtIndex, and o GetValueForExpressionPath llvm-svn: 135315
* Update the test scenario for find_global_variables() to now start the ↵Johnny Chen2011-07-111-4/+4
| | | | | | | | | | | | inferior process before issuing API calls to find the global variable and to get its value. rdar://problem/9700873 has been updated to reflect the latest status. The dwarf case now does not seg fault if the inferior is not started; instead, for dwarf case, the value retrieved from the global variable is None. llvm-svn: 134909
* Add TestPrintObj.py to go with lang/objc/print-objc, which:Johnny Chen2011-06-271-1/+3
| | | | | | | | | | | Test "print object" where another thread blocks the print object from making progress. Set a breakpoint on the line in my_pthread_routine. Then switch threads to the main thread, and do print the lock_me object. Since that will try to get the lock already gotten by my_pthread_routime thread, it will have to switch to running all threads, and that should then succeed. llvm-svn: 133933
* o lldbtest.py:Johnny Chen2011-06-231-0/+9
| | | | | | | | | | | | | | | | | | Assign the test method name to self.testMethodName. This can be useful for the test directory (see test/types for a good example) which houses a bunch of executables compiled from different source files. The default build action is to create a.out as the binary executable, which can confuse the module cacheing mechanism and result in the debugger getting a stale image as the target to be debugged, and chaos ensues. o AbstractBase.py, TestThreadAPI.py: Use self.testMethodName to our advantage. o TestLoadUnload.py: Add expected failure marker to test case test_modules_search_paths(). llvm-svn: 133768
* For now, insert some delays between succesive test cases in the test/types ↵Johnny Chen2011-06-211-6/+11
| | | | | | | | | | directory if not already specified by the test driver (via ./dotest -w). Remove the AbstractBase.setUp() method definition when/if we find out the cause of the failures if no delays are inserted between these test cases. llvm-svn: 133495
* Add a builder module for Linux (plus some refactoring)Peter Collingbourne2011-06-201-8/+11
| | | | llvm-svn: 133457
* Simplify the base test class. Remove keyword argument setCookie from ↵Johnny Chen2011-06-151-11/+1
| | | | | | | | | TestBase.runCmd() and remove the self.runStarted attribute since the automatic shutdown of processes associated with the targets are now performed automatically. llvm-svn: 133092
* Add an API to SBDebugger class:Johnny Chen2011-06-151-18/+16
| | | | | | | | | | | | | | | | | bool SBDebugger::DeleteTarget(lldb::SBTarget &target); which is used in the test tearDown() phase to cleanup the debugger's target list so that it won't grow larger and larger as test cases are executed. This is also a good opportunity to get rid of the arcane requirement that test cases exercising the Python API must assign the process object to self.process so that it gets shutdown gracefully. Instead, the shutdown of the process associated with each target is now being now automatically. Also get rid of an API from SBTarget class: SBTarget::DeleteTargetFromList(lldb_private::TargetList *list); llvm-svn: 133091
* Removed unneeded method breakAfterLaunch() from the TestBase class to ↵Johnny Chen2011-06-131-40/+0
| | | | | | | | simplify our base class. It was introduced to work around some debugger infrastructure bug which has long since been fixed. llvm-svn: 132951
* Remove extra whitespace.Johnny Chen2011-06-061-1/+0
| | | | llvm-svn: 132692
* Fix out-dated module docstring for lldbtest.py. Also wrap some lldb ↵Johnny Chen2011-05-311-16/+25
| | | | | | | | attribute references inside a try-except block in case the test is not invoked through the dotest.py test driver. llvm-svn: 132372
* Move some comments to the docstrings.Johnny Chen2011-05-311-13/+5
| | | | llvm-svn: 132367
* Fix some comments.Johnny Chen2011-05-271-3/+3
| | | | llvm-svn: 132232
* Add comment headers describing some method groups of our TestBase class.Johnny Chen2011-05-271-1/+12
| | | | | | Remove an unnecessary __import__() function call. llvm-svn: 132231
* Convert these two modules to use the compact truth value testing as well.Johnny Chen2011-05-251-2/+2
| | | | llvm-svn: 132072
* Add an API test script file for SBCommandInterpreter.Johnny Chen2011-05-061-0/+2
| | | | llvm-svn: 131035
* For a test with unexpected success status, we also dump its session info ↵Johnny Chen2011-05-061-6/+20
| | | | | | into a unique file. llvm-svn: 131011
* Comment.Johnny Chen2011-05-051-2/+3
| | | | llvm-svn: 130965
* Add comment for self.child_in_script_interpreter.Johnny Chen2011-05-051-2/+5
| | | | llvm-svn: 130963
* Use standard lldb enum -- lldb.eStopReasonBreakpoint.Johnny Chen2011-05-051-1/+1
| | | | llvm-svn: 130960
* Add a test script for verifying that the convenience variables:Johnny Chen2011-05-051-0/+4
| | | | | | | | | | | | o lldb.debugger o lldb.target o lldb.process o lldb.thread o lldb.frame "just works" when we stop at a breakpoint. llvm-svn: 130904
* Use a more gentle way of shutting down the child process spawned during the ↵Johnny Chen2011-05-031-2/+5
| | | | | | | | test execution using pexpect. Change some child.expect() to child.expect_exact() as they try to match the string, not a regular expression. llvm-svn: 130797
* A more robust pexpect-based test case for testing against the firing of stop ↵Johnny Chen2011-05-031-0/+3
| | | | | | | | | | | | hooks. Change one test sequence to detect the '** End Stop Hooks **' marker emitted by the stop hooks mechanism and check for whether the 'expr ptr' stop-hook has been run. Also, change the TestBase.tearDown() to wait for 2 seocnds before forcefully kill the pexpect-spawned child lldb process. llvm-svn: 130767
* Change the rest of lldbutil.py's function names to all lower case formats to ↵Johnny Chen2011-04-271-3/+3
| | | | | | | | be consistent. And modify the test cases accordingly. llvm-svn: 130314
OpenPOWER on IntegriCloud