summaryrefslogtreecommitdiff
path: root/lldb/test/python_api/event/TestEvents.py
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-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-14Marked TestEvents test as flakey on Linux.Todd Fiala
It's passing all the time for me (50/50), and was passing what looks like 9/10 times for the originator. llvm-svn: 247639
2015-09-11XFAIL miscellaneous tests on windows.Zachary Turner
llvm.org/pr24778 llvm-svn: 247460
2015-07-22Fix typos.Bruce Mitchener
Summary: Fix a bunch of typos. Reviewers: clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D11386 llvm-svn: 242856
2015-06-02Un-enable TestEvents test on linuxPavel Labath
Test still seems to fail about 1/10 runs. Skipping the test, but it a more greppable fashion. llvm-svn: 238826
2015-06-02Enable TestEvents test on linuxPavel Labath
This test was very inconspicuosly skipped on linux, when it was crashing for local debugging. It seems to work fine with LLGS, so I'm enabling it. llvm-svn: 238816
2015-05-21Add bug number for TestEventsTamas Berghammer
llvm-svn: 237904
2015-05-21XFAIL TestEvents on Linux bacuse it is flakyTamas Berghammer
llvm-svn: 237888
2015-05-08[TestEvents] Add a 'connected' state to include remote debugging.Siva Chandra
Test Plan: dotest.py -p TestEvents Reviewers: vharron, chaoren Reviewed By: chaoren Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D9581 llvm-svn: 236800
2015-05-04un-skipped a bunch of tests on LinuxVince Harron
Some have been marked as skipIfLinux for years. The seem to be passing so I've enabled them. Differential Revision: http://reviews.llvm.org/D9428 llvm-svn: 236403
2015-04-02Many many test failures after some recent changes. The problem is ↵Greg Clayton
lldbtest.getPlatform() returns the "OS" of the selected platform's triple. This is "macosx" for desktop macosx and "ios" for iOS. It used to be "darwin". There was a lot of code that was checking "if self.getPlatform() == 'darwin'" which is not correct. I fixed this by adding a: lldbtest.platformIsDarwin() which returns true if the current platform's OS is "macosx", "ios" or "darwin". These three valid darwin are now returned by a static function: lldbtest.getDarwinOSTriples() Fixed up all places that has 'if self.getPlatform() == "darwin":' with "if self.platformIsDarwin()" and all instances of 'if self.getPlatform() != "darwin":' with "if not self.platformIsDarwin()". I also fixed some darwin decorator functions to do the right thing as well. llvm-svn: 233933
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
2014-12-19[TestEvents] Replace expectedFailureLinux with skipIfLinuxSiva Chandra
Summary: If we do not mark them as skip, they are still executed, which in turn is leading to an assertion failure. The change also adds skipIfLinux to a testlet which was not previously marked with skipIfLinux. This is because running even that test let leads to an assertion failure. Test Plan: dotest.py -C clang -p TestEvents.py Reviewers: vharron Reviewed By: vharron Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D6715 llvm-svn: 224644
2014-11-22Mark 9 lldb unit tests for ubuntu as XFAIL.Siva Chandra
The following lldb unit tests fail check-lldb on ubuntu: TestDataFormatterStdMap.py TestDataFormatterStdVBool.py TestDataFormatterStdVector.py TestDataFormatterSynthVal.py TestEvents.py TestInitializerList.py TestMemoryHistory.py TestReportData.py TestValueVarUpdate.py These unit test failures are for non-core functionality. The intent is to reduce the check-lldb FAILS to core functionality FAILS and then circle back later and fix these FAILS at a later date. llvm-svn: 222608
2014-10-29Temporarily disable test on FreeBSD that is assertingEd Maste
llvm.org/pr21325 llvm-svn: 220871
2014-10-17Fixed python API event test cases.Greg Clayton
Issues were: 1 - It isn't good to have more than one listener for the process events, just supply a listener at launch instead of making a one then have the process broadcaster add a new listener 2 - run in async mode llvm-svn: 220113
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
2012-11-23Remove decorator to skip event testsDaniel Malea
- hang resolved in r168503 llvm-svn: 168530
2012-11-19Temporarily skip tests known to hang on LinuxDaniel Malea
- opened bugzilla defects #14384 and #14385 llvm-svn: 168323
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
2011-07-20A more succinct assertTrue.Johnny Chen
llvm-svn: 135544
2011-07-20Minor change; add an assertTrue stmt.Johnny Chen
llvm-svn: 135542
2011-07-11Passing in os.ctermid() as the arg for SBTarget.Launch(...) for stdin_path, ↵Johnny Chen
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-08o TestEvents.py:Johnny Chen
Add a usage example of SBEvent APIs. o SBEvent.h and SBListener.h: Add method docstrings for SBEvent.h and SBListener.h, and example usage of SBEvent into the class docstring of SBEvent. o lldb.swig: Add typemap for SBEvent::SBEvent (uint32_t event, const char *cstr, uint32_t cstr_len) so that we can use, in Python, obj2 = lldb.SBEvent(0, "abc") to create an SBEvent. llvm-svn: 134766
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-04-23Convert the rest of the test suite to use the lldbutil.get_description() ↵Johnny Chen
utility function. llvm-svn: 130041
2011-04-19Converted to use SBProcess.LaunchSimple().Johnny Chen
llvm-svn: 129789
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
2010-12-22No need to pass an empty string as an arg or as an env string to the ↵Johnny Chen
SBTarget.LaunchProcess() API. llvm-svn: 122450
2010-12-22Fix some typos in the docstrings and also update the test method names.Johnny Chen
llvm-svn: 122382
2010-12-22Add test cases for registering a listener object with the broadcaster of a ↵Johnny Chen
process and waiting for two expected state changed events to arrive: "running" followed by "stopped". llvm-svn: 122380
2010-12-21Rename the test methods to be more meaningful.Johnny Chen
llvm-svn: 122352
2010-12-21Set the debugger to asynchronous mode before using the Python API call to killJohnny Chen
the process. The custom thread started before this point is running in a loop waiting for events to come. llvm-svn: 122316
2010-12-21Fix typo.Johnny Chen
llvm-svn: 122306
2010-12-21Added python_api/event/TestEvents.py to get the listener object associated ↵Johnny Chen
with the debugger and to exercise some event APIs. llvm-svn: 122304