summaryrefslogtreecommitdiff
path: root/lldb/test/python_api/frame
AgeCommit message (Collapse)Author
2015-10-28Move lldb/test to lldb/packages/Python/lldbsuite/test.Zachary Turner
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
2015-10-27Rename `lldb_shared` to `use_lldb_suite`.Zachary Turner
llvm-svn: 251444
2015-10-26Port the python api decorator to use test categoriesPavel Labath
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
2015-10-23Add from __future__ import print_function everywhere.Zachary Turner
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
2015-10-22Update every test to import `lldb_shared`.Zachary Turner
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
2015-10-21Use six to portably handle module renames in Python 2 and 3Zachary Turner
llvm-svn: 250915
2015-09-30Merge dwarf and dsym testsTamas Berghammer
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
2015-09-11XFAIL miscellaneous tests on windows.Zachary Turner
llvm.org/pr24778 llvm-svn: 247460
2015-03-30Replace sys.platform skips in tests with @skip decorators which check ↵Robert Flack
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
2013-12-13Correctly set the working directory when launching processes for both local ↵Greg Clayton
and remote targets. llvm-svn: 197266
2013-12-10Massive test suite cleanup to stop everyone from manually having to compute ↵Greg Clayton
"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
2013-10-30Removing expected failure decorator for a test that's passing.Andrew Kaylor
llvm-svn: 193715
2013-09-26Mark 32/64-bit tests as expected fail after root causing and referencing ↵Matt Kopec
bugzilla. Fix TestFrames.py error to check against a None pc value. llvm-svn: 191470
2013-07-31Set an extra debug flag when testing with ICC so that it generates the ↵Matt Kopec
correct debug info for inlined tests. llvm-svn: 187500
2012-04-06Second batch of adding @dsym_test/@dwarf_test decorators to existing test cases.Johnny Chen
Plus some minor cleanup of test method names. Third and final batch is coming. llvm-svn: 154197
2012-04-05Added a new Host class: ReadWriteLockGreg Clayton
This abstracts read/write locks on the current host system. It is currently backed by pthread_rwlock_t objects so it should work on all unix systems. We also need a way to control multi-threaded access to the process through the public API when it is running. For example it isn't a good idea to try and get stack frames while the process is running. To implement this, the lldb_private::Process class now contains a ReadWriteLock member variable named m_run_lock which is used to control the public process state. The public process state represents the state of the process as the client knows it. The private is used to control the actual current process state. So the public state of the process can be stopped, yet the private state can be running when evaluating an expression for example. Adding the read/write lock where readers are clients that want the process to stay stopped, and writers are clients that run the process, allows us to accurately control multi-threaded access to the process. Switched the SBThread and SBFrame over to us shared pointers to the ExecutionContextRef class instead of making their own class to track this. This fixed an issue with assigning on SBFrame to another and will also centralize the code that tracks weak references to execution context objects into one location. llvm-svn: 154099
2012-03-05rdar://problem/10976649Johnny Chen
Add SBFrame::IsEqual(const SBFrame &that) method and export it to the Python binding. Alos add a test case test_frame_api_IsEqual() to TestFrames.py file. llvm-svn: 152050
2011-12-19Add test_frame_api_boundary_condition() test case to exercise a bunch of ↵Johnny Chen
boundary condition inputs. llvm-svn: 146924
2011-10-10Remove test logic to check for clang and skip the rest due to insufficient ↵Johnny Chen
debug info. Recent changes in lldb inlining robustness seem to have fixed it. llvm-svn: 141595
2011-08-03Cleaned up the SBType.h file to not include internal headers and reorganizedGreg Clayton
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-07-26Add skip test for clang, which has insufficient debug info for call site in ↵Johnny Chen
main(). llvm-svn: 136184
2011-07-13Modify the test script to better handle the different inlining behaviors ofJohnny Chen
clang/gcc/llvm-gcc. If the first breakpoint is due to stop at an inlined frame, test that the call site corresponds to where it should be. Also add an expecr for a second break stop, if the first break stop corresponds to an inlined call frame #0. rdar://problem/9741470 llvm-svn: 135100
2011-07-08Rearranged the debug output to come before the assert for function name ↵Johnny Chen
'outer_inline'. Right now clang-139 fails the test. llvm-svn: 134673
2011-06-20Add TestInlinedFrame.py to exercise the newly added SBFrame APIs: ↵Johnny Chen
IsInlined() and GetFunctionName(). llvm-svn: 133404
2011-06-15The extra burden for the Python API test case to assign its process object ↵Johnny Chen
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-05-24Now that we have added a post-processing step for adding truth value testing toJohnny Chen
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
2011-05-13Clean up the test a little bit; and use lldbutil.get_GPRs(frame) to retrieve ↵Johnny Chen
the general purpose register set. llvm-svn: 131324
2011-04-28Modify the test suite and lldbutil.py to utilize the Python iteration ↵Johnny Chen
pattern now that the lldb iteration protocol has been added to lldb.py module. llvm-svn: 130452
2011-04-19Converted to use SBProcess.LaunchSimple().Johnny Chen
And use self.TraceOn() API. llvm-svn: 129790
2011-03-31Remove unneeded ExecutionContextScope variables.Jim Ingham
llvm-svn: 128685
2011-02-03Modify test scripts to accomodate SBTarget.Launch() API change.Johnny Chen
llvm-svn: 124828
2011-01-23Deprecated old forms of SBTarget::Launch. There is not just one and noGreg Clayton
SWIG renaming done to work around deprecated APIs. llvm-svn: 124075
2011-01-10Fix wrong test case in main.c. Oops!Johnny Chen
llvm-svn: 123181
2010-12-23Add a test case for the SBFrame APIs. In particular, it uses the frame API toJohnny Chen
get the argument values of the call stacks when stopped on the breakpoint. Radar has been filed for the expected failures: test failure: ./dotest.py -v -w -t -p TestFrames (argument values are wrong) llvm-svn: 122460