summaryrefslogtreecommitdiffstats
path: root/lldb/test/python_api/thread
Commit message (Collapse)AuthorAgeFilesLines
* Move lldb/test to lldb/packages/Python/lldbsuite/test.Zachary Turner2015-10-284-330/+0
| | | | | | | | | | | This is the conclusion of an effort to get LLDB's Python code structured into a bona-fide Python package. This has a number of benefits, but most notably the ability to more easily share Python code between different but related pieces of LLDB's Python infrastructure (for example, `scripts` can now share code with `test`). llvm-svn: 251532
* Rename `lldb_shared` to `use_lldb_suite`.Zachary Turner2015-10-271-1/+1
| | | | llvm-svn: 251444
* Port the python api decorator to use test categoriesPavel Labath2015-10-261-5/+5
| | | | | | | | | | | | | | | | | | Summary: Per discussions on the mailing list, I have implemented a decorator which annotates individual test methods with categories. I have used this framework to replace the '-a' and '+a' command-line switches (now '-G pyapi' and '--skip-category pyapi') and the @python_api_test decorator (now @add_test_categories('pyapi')). The test suite now gives an error message suggesting the new options if the user specifies the deprecated +/-a switches. If the general direction is good, I will follow this up with other switches. Reviewers: tberghammer, tfiala, granata.enrico, zturner Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D14020 llvm-svn: 251277
* Add from __future__ import print_function everywhere.Zachary Turner2015-10-231-3/+5
| | | | | | | | | | | | | Apparently there were tons of instances I missed last time, I guess I accidentally ran 2to3 non-recursively. This should be every occurrence of a print statement fixed to use a print function as well as from __future__ import print_function being added to every file. After this patch print statements will stop working everywhere in the test suite, and the print function should be used instead. llvm-svn: 251121
* Update every test to import `lldb_shared`.Zachary Turner2015-10-221-8/+2
| | | | | | | | | | | | | | | | | | | | | This is necessary in order to allow third party modules to be located under lldb/third_party rather than under the test folder directly. Since we're already touching every test file anyway, we also go ahead and delete the unittest2 import and main block wherever possible. The ability to run a test as a standalone file has already been broken for some time, and if we decide we want this back, we should use unittest instead of unittest2. A few places could not have the import of unittest2 removed,because they depend on the unittest2.expectedFailure or skip decorators. Removing all those was orthogonal in spirit to the purpose of this CL, so the import of unittest2 remains in those files that were using it for its test decorators. Those can be addressed separately. llvm-svn: 251055
* Merge dwarf and dsym testsTamas Berghammer2015-09-301-67/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently most of the test files have a separate dwarf and a separate dsym test with almost identical content (only the build step is different). With adding dwo symbol file handling to the test suit it would increase this to a 3-way duplication. The purpose of this change is to eliminate this redundancy with generating 2 test case (one dwarf and one dsym) for each test function specified (dwo handling will be added at a later commit). Main design goals: * There should be no boilerplate code in each test file to support the multiple debug info in most of the tests (custom scenarios are acceptable in special cases) so adding a new test case is easier and we can't miss one of the debug info type. * In case of a test failure, the debug symbols used during the test run have to be cleanly visible from the output of dotest.py to make debugging easier both from build bot logs and from local test runs * Each test case should have a unique, fully qualified name so we can run exactly 1 test with "-f <test-case>.<test-function>" syntax * Test output should be grouped based on test files the same way as it happens now (displaying dwarf/dsym results separately isn't preferable) Proposed solution (main logic in lldbtest.py, rest of them are test cases fixed up for the new style): * Have only 1 test fuction in the test files what will run for all debug info separately and this test function should call just "self.build(...)" to build an inferior with the right debug info * When a class is created by python (the class object, not the class instance), we will generate a new test method for each debug info format in the test class with the name "<test-function>_<debug-info>" and remove the original test method. This way unittest2 see multiple test methods (1 for each debug info, pretty much as of now) and will handle the test selection and the failure reporting correctly (the debug info will be visible from the end of the test name) * Add new annotation @no_debug_info_test to disable the generation of multiple tests for each debug info format when the test don't have an inferior Differential revision: http://reviews.llvm.org/D13028 llvm-svn: 248883
* Last set of XFAILs for Windows.Zachary Turner2015-09-161-0/+1
| | | | llvm-svn: 247825
* Fix TestThreadAPI on LinuxTamas Berghammer2015-06-251-6/+4
| | | | | | | On Linux malloc calls itself in some case. Change the test case to handle this scenario. llvm-svn: 240651
* Enabled a bunch of tests on LinuxVince Harron2015-03-311-1/+1
| | | | | | | | | Removed expectedFailureLinux from failures that I was unable to reproduce, updated and improved some other comments near XFAIL tests Differential Revision: http://reviews.llvm.org/D8676 llvm-svn: 233716
* Replace sys.platform skips in tests with @skip decorators which check ↵Robert Flack2015-03-301-5/+5
| | | | | | | | | | | | | | | | against remote platform. Adds @skipIfPlatform and @skipUnlessPlatform decorators which will skip if / unless the target platform is in the provided platform list. Test Plan: ninja check-lldb shows no regressions. When running cross platform, tests which cannot run on the target platform are skipped. Differential Revision: http://reviews.llvm.org/D8665 llvm-svn: 233547
* Add decorator for FreeBSD test failure - malloc() breakpoint issueEd Maste2014-08-011-0/+1
| | | | | | llvm.org/pr20476 llvm-svn: 214527
* Fix malloc thread step-out test on FreeBSDEd Maste2014-03-071-1/+9
| | | | | | | | | | | | | | | | After hitting the malloc() breakpoint on FreeBSD our top frame is actually an inlined function malloc_init. * frame #0: 0x0000000800dcba19 libc.so.7`malloc [inlined] malloc_init at malloc.c:5397 frame #1: 0x0000000800dcba19 libc.so.7`malloc(size=1024) + 9 at malloc.c:5949 frame #2: 0x00000000004006e5 test_step_out_of_malloc_into_function_b_with_dwarf`b(val=1) + 37 at main2.cpp:29 Add a heuristic to keep stepping out until we come to a non-malloc caller, before checking if it is our desired caller from the test code. llvm.org/pr17944 llvm-svn: 203268
* Correctly set the working directory when launching processes for both local ↵Greg Clayton2013-12-131-5/+5
| | | | | | and remote targets. llvm-svn: 197266
* Massive test suite cleanup to stop everyone from manually having to compute ↵Greg Clayton2013-12-101-1/+1
| | | | | | | | | | "mydir" inside each test case. This has led to many test suite failures because of copy and paste where new test cases were based off of other test cases and the "mydir" variable wasn't updated. Now you can call your superclasses "compute_mydir()" function with "__file__" as the sole argument and the relative path will be computed for you. llvm-svn: 196985
* test: Add annotation for FreeBSD failures w/ threaded inferiorsEd Maste2013-12-091-0/+1
| | | | | | | llvm.org/pr17944 llvm.org/pr17946 llvm-svn: 196786
* Clean up linux test decorators and add links to known bugsDaniel Malea2013-05-151-1/+1
| | | | | | | | | - s/skipOnLinux/skipIfLinux/ to match style of every other decorator - linkify bugizilla/PR numbers in comments No intended change in functionality. llvm-svn: 181913
* Fixed incorrect python that was trying to validate that we got a valid ↵Greg Clayton2013-03-191-5/+5
| | | | | | | | lldb.SBThread object by checking to see if it is equal to "None". This test is incorrect as functions that return lldb.SBThread objects never return None, they just return lldb.SBThread objects that contain invalid opaque classes. llvm-svn: 177416
* Update test status on LinuxDaniel Malea2012-11-231-0/+1
| | | | | | | | | - add decorators @expectedFailLinux and @skipOnLinux - skip/mark xfail cases due to open bugzillas # 14323, 14416, 14423, 14424, 14425, 14426 Patch by Ashok Thirumurthi! llvm-svn: 168529
* Second batch of adding @dsym_test/@dwarf_test decorators to existing test cases.Johnny Chen2012-04-061-0/+10
| | | | | | | Plus some minor cleanup of test method names. Third and final batch is coming. llvm-svn: 154197
* Fix Python docstring for SBThread.GetStopDescription().Johnny Chen2011-12-191-1/+1
| | | | llvm-svn: 146890
* Remove the @expectedFailureClang custom decorator for indicating ↵Johnny Chen2011-09-261-2/+3
| | | | | | | | clang-specific test failures. It has been fixed on the lldb side to compensate for bad debug info (line table information). llvm-svn: 140550
* Add a decorator for marking clang only expectedFailure. Use it for the ↵Johnny Chen2011-08-191-0/+4
| | | | | | | | | | | | | | | | | | | | 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
* o lldbtest.py:Johnny Chen2011-06-231-31/+34
| | | | | | | | | | | | | | | | | | 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, use 'b.out' compiled from main2.cpp as the executable name for ↵Johnny Chen2011-06-231-11/+6
| | | | | | | | test_run_to_address_with_dsym/dwarf() to distinguish between other test cases which use 'a.out' compiled from main.cpp. llvm-svn: 133764
* The extra burden for the Python API test case to assign its process object ↵Johnny Chen2011-06-151-16/+16
| | | | | | | | | 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
* Comment change.Johnny Chen2011-05-261-1/+1
| | | | llvm-svn: 132150
* Now that we have added a post-processing step for adding truth value testing toJohnny Chen2011-05-241-12/+12
| | | | | | | those lldb objects which implement the IsValid() method, let's change the rest of the test suite to use the more compact truth value testing pattern (the Python way). llvm-svn: 131970
* Converted to use SBProcess.LaunchSimple().Johnny Chen2011-04-191-17/+8
| | | | | | And use self.TraceOn() API. llvm-svn: 129797
* Add test cases to exercise the SBThread.GetProcess() API. We launch the ↵Johnny Chen2011-03-111-2/+58
| | | | | | | | | | process using the SBTarget.Launch() API, stop at a breakpoint, get the stopped thread, and verify that the pid of the stopped thread's process is equal to the pid of the process returned by SBTarget.Launch(). llvm-svn: 127444
* Add a test case test_run_to_address() to exercise the ↵Johnny Chen2011-03-111-0/+53
| | | | | | | | SBThread.RunToAddress(lldb::addr_t addr) API. The test itself is not working yet. llvm-svn: 127436
* Add test cases to TestThreadAPI.py to exercise SBThread.StepOver() by ↵Johnny Chen2011-03-102-2/+61
| | | | | | | | stopping at a breakpoint, doing three step-over's, then verifying that the correct source line number is reached. llvm-svn: 127432
* Test cleanup. Check for the full caller symbol of malloc -- b(int).Johnny Chen2011-03-101-11/+11
| | | | llvm-svn: 127421
* Add test cases for Python SBThread.StepOut() API by stepping out of a malloc ↵Johnny Chen2011-03-093-2/+111
| | | | | | | | call where the call site is at function b(). Verifies that after the thread.StepOut(), we are at the correct line within function b. llvm-svn: 127374
* Add TestThreadAPI.py file to house the Python SBThread API test cases.Johnny Chen2011-03-073-0/+97
Currently it has only test cases for SBThread.GetStopDescription() API. Also modified lldb.swig to add typemap for (char *dst, size_t dst_len) which occurs for SBThread::GetStopDescription() C++ API. For Python scripting: # Due to the typemap magic (see lldb.swig), we pass in an (int)length to GetStopDescription # and expect to get a Python string as the result object! # The 100 is just an arbitrary number specifying the buffer size. stop_description = thread.GetStopDescription(100) llvm-svn: 127173
OpenPOWER on IntegriCloud