summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test
Commit message (Collapse)AuthorAgeFilesLines
* A number of improvements to decorator conditionals.Zachary Turner2016-02-084-28/+30
| | | | | | | | | | | | | | | | | | | * Change the `not_in` function to be called `no_match`. This makes it clear that keyword arguments can be more than just lists. * Change the name of `_check_list_or_lambda` to `_match_decorator_property`. Again clarifying that decorator params are not always lists. * Always use a regex match when matching strings. This allows automatic support for regex matching on all decorator properties. Also support compiled regex values. * Fix a bug in the compiler check used by _decorateTest. The two arguments were reversed, the condition was always wrong. * Change one test that uses skipUnlessArch to use skipIf, to demonstrate that skipIf can now handle more scenarios. Differential Revision: http://reviews.llvm.org/D16938 llvm-svn: 260135
* Remove expectedFailureWindows decorator.Zachary Turner2016-02-08117-193/+181
| | | | | | | | | | | | | | | expectedFailureWindows is equivalent to using the general expectedFailureAll decorator with oslist="windows". Additionally, by moving towards these common decorators we can solve the issue of having to support decorators that can be called with or without arguments. Once all decorators are always called with arguments, and this is enforced by design (because you can't specify the condition you're decorating for without passing an argument) the implementation of the decorators can become much simpler Differential Revision: http://reviews.llvm.org/D16936 llvm-svn: 260134
* Show real error message in -data-evaluate-expressionEugene Leviant2016-02-081-1/+1
| | | | llvm-svn: 260082
* Revert "Enable test_lldbmi_settings_set_target_run_args_before on linux"Pavel Labath2016-02-081-0/+1
| | | | | | Test is still flaky. llvm-svn: 260081
* Fix an issue where certain CommandObjects (or Options thereof) were being ↵Enrico Granata2016-02-061-0/+48
| | | | | | | | | | created once, bound to a specific CommandInterpreter (and hence a specific Debugger), and then cached for reuse across different Debugger instances Obviously, if the original Debugger goes away, those commands are holding on to now stale memory, which has the potential to cause crashes Fixes rdar://24460882 llvm-svn: 259964
* Take 2: Use an artifical namespace so that member vars do not hide local vars.Siva Chandra2016-02-053-0/+275
| | | | | | | | | | | | Summary: This relands r259810 with fix for failures on Mac. Reviewers: spyffe, tfiala Subscribers: tfiala, lldb-commits Differential Revision: http://reviews.llvm.org/D16900 llvm-svn: 259902
* Bump up the packet timeout for gdbremote testsPavel Labath2016-02-051-1/+1
| | | | | | | Log confirmed that the we are sometimes timing out on the receive, even though the server is sending the correct packets. llvm-svn: 259878
* Move the rest of the tests over to using the new decorator module.Zachary Turner2016-02-04343-803/+1246
| | | | llvm-svn: 259838
* Revert "Use an artifical namespace so that member vars do not hide local vars."Siva Chandra2016-02-043-275/+0
| | | | | | | | | | | | | | Summary: This reverts commit 8af14b5f9af68c31ac80945e5b5d56f0a14b38e4. Reverting as it breaks a few tests on Mac. Reviewers: spyffe Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D16895 llvm-svn: 259823
* Use an artifical namespace so that member vars do not hide local vars.Siva Chandra2016-02-043-0/+275
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: While evaluating expressions when stopped in a class method, there was a problem of member variables hiding local variables. This was happening because, in the context of a method, clang already knew about member variables with their name and assumed that they were the only variables with those names in scope. Consequently, clang never checks with LLDB about the possibility of local variables with the same name and goes wrong. This change addresses the problem by using an artificial namespace "$__lldb_local_vars". All local variables in scope are declared in the "$__lldb_expr" method as follows: using $__lldb_local_vars::<local var 1>; using $__lldb_local_vars::<local var 2>; ... This hides the member variables with the same name and forces clang to enquire about the variables which it thinks are declared in $__lldb_local_vars. When LLDB notices that clang is enquiring about variables in $__lldb_local_vars, it looks up local vars and conveys their information if found. This way, member variables do not hide local variables, leading to correct evaluation of expressions. A point to keep in mind is that the above solution does not solve the problem for one specific case: namespace N { int a; } class A { public: void Method(); int a; }; void A::Method() { using N::a; ... // Since the above solution only touches locals, it does not // force clang to enquire about "a" coming from namespace N. } Reviewers: clayborg, spyffe Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D16746 llvm-svn: 259810
* Move some of the common decorators to decorators.py.Zachary Turner2016-02-0433-278/+331
| | | | | | | | | | | | This doesn't attempt to move every decorator. The reason for this is that it requires touching every single test file to import decorators.py. I would like to do this in a followup patch, but in the interest of keeping the patches as bite-sized as possible, I've only attempted to move the underlying common decorators first. A few tests call these directly, so those tests are updated as part of this patch. llvm-svn: 259807
* Enable test_lldbmi_settings_set_target_run_args_before on linuxPavel Labath2016-02-041-1/+0
| | | | | | Test has passed last 200 runs of the build bot. llvm-svn: 259777
* Mark TestProcessIO as flaky on androidPavel Labath2016-02-041-1/+5
| | | | | | | previously, I have marked only one test as flaky, but now I noticed another test failing with the same error. I am going to assume all of them are flaky. llvm-svn: 259775
* Add verbose logging support to gdb-remote testsPavel Labath2016-02-041-7/+39
| | | | | | | | | | | | | | | | | | Summary: gdb-remote tests are not able to use the same logging mechanisms as the rest of our tests, and currently we get no host logs from them, even though the tests themselves have logging capability. This commit changes that. When user specifies that he would like to log the gdb-remote channel (--channel gdb-remote argument to dotest.py), we write detailed logs to the <TEST_ID>-host.log file, just like we would in the case of regular tests. If this argument is not specified, we only log the serious messages to stderr, which matches the existing behaviour. Reviewers: tfiala, tberghammer Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D16858 llvm-svn: 259774
* Fix missing module qualification of subprocess.PIPE.Zachary Turner2016-02-031-1/+1
| | | | llvm-svn: 259724
* The SetStopInfo from a Mach Exception was setting the stopJim Ingham2016-02-031-1/+0
| | | | | | | | | | reason to None when we stop due to a trace, then noticed that we were on a breakpoint that was not valid for the current thread. That should actually have set it back to trace. This was pr26441 (<rdar://problem/24470203>) llvm-svn: 259684
* Move some android platform functions to lldbplatformutil.Zachary Turner2016-02-033-79/+80
| | | | | | | | | | | | | | | | | | | My eventual goal is to move all of the test decorators to their own module such as `decorators.py`. But some of the decorators use existing functions in `lldbtest.py` and conceptually the functions are probably more appropriately placed in lldbplatformutil. Moreover, lldbtest.py is a huge file with a ton of random utility functions scattered around, so this patch also workds toward the goal of reducing the footprint of this one module to a more reasonable size. So this patch moves some of them over to lldbplatformutil with the eventual goal of moving decorators over to their own module. Reviewed By: Tamas Berghammer, Pavel Labath Differential Revision: http://reviews.llvm.org/D16830 llvm-svn: 259680
* Remove skipUnlessListedRemote test decoratorPavel Labath2016-02-032-17/+0
| | | | | | | | | | | | | | This decorator was used in only one test, and it's behaviour was quite complicated. It skipped if: - test was remote - platform was *not* android I am not aware of anyone running tests with this configuration (and even then, I am not aware of a reason why the test should not pass), but if TestLoadUnload starts breaking for you after this commit, please disable the test with @expectedFailureAll(remote=True, oslist=[YOUR_PLATFORM]) llvm-svn: 259642
* Fix inverted conditional in TestInferiorAssert.pyZachary Turner2016-02-021-2/+2
| | | | llvm-svn: 259608
* Don't return a tuple from the skip test function.Zachary Turner2016-02-023-34/+36
| | | | | | | | | | | Previously we were returning a tuple of (bool, skip_reason) from the tuple function. This makes for some awkward code, especially since a value of True for the first argument implies that the second argument is None, and a value of False implies that the second argument is not None. So it was basically redundant, and with this patch we simply return the skip reason or None directly. llvm-svn: 259590
* Re-write many skip decorators to use shared code.Zachary Turner2016-02-021-205/+90
| | | | | | | | | | | | | This should be no functional change, just a refactoring of the skip decorators to all centralize on a single function, `skipTestIfFn` that does all the logic. This allows easier maintenance of the decorators and also centralizes all the hard-to-understand logic in one place. Reviewed by: Pavel Labath Differential Revision: http://reviews.llvm.org/D16741 llvm-svn: 259543
* XFAIL TestConsecutiveBreakpoints.test_single_step_thread_specific on OSXPavel Labath2016-02-021-0/+1
| | | | llvm-svn: 259527
* skip TestWatchLocation on OS XTodd Fiala2016-02-021-0/+1
| | | | | | | | Skipping this test while I investigate. It started failing with r259379. (It is generating an error due to unicode decode issues.) llvm-svn: 259526
* Remove redundant test in TestExitDuringStepPavel Labath2016-02-021-12/+4
| | | | | | | | | After recent changes, test_thread_state_is_stopped has become equivalent to test_step_in, as the function exit_during_step_base was not using the "test_thread_state" parameter. As test was XFAILed on all platforms anyway, and we have other tests for the bug which it (used to) test, I am simply removing the function. llvm-svn: 259517
* Mark TestProcessIO.test_stdin_redirection as flaky on androidPavel Labath2016-02-021-0/+1
| | | | | | bug #26437 llvm-svn: 259513
* Fix single-stepping onto a breakpointPavel Labath2016-02-021-25/+67
| | | | | | | | | | | | | | | Summary: r259344 introduced a bug, where we fail to perform a single step, when the instruction we are stepping onto contains a breakpoint which is not valid for this thread. This fixes the problem and add a test case. Reviewers: tberghammer, emaste Subscribers: abhishek.aggarwal, lldb-commits, emaste Differential Revision: http://reviews.llvm.org/D16767 llvm-svn: 259488
* Fix compiler lookup when specified without pathPavel Labath2016-02-022-2/+3
| | | | | | | | | r259433 introduced a regression, where if a compiler is specified without a path (e.g., CC=clang, relying on the fact that clang is in $PATH), then the test suite would fail (at the compiler version detection step) because realpath would interpret this as a path relative to cwd). The fix is to perform the $PATH expansion (via `which`) before the realpath step. llvm-svn: 259484
* Fix getCompiler in unit testing framework on compiler symlinksStephane Sezer2016-02-011-1/+2
| | | | | | | | | | | | | | | | Summary: Checks using the result of getCompiler() will fail to identify the compiler correctly if CC is a symlink path (ie /usr/bin/cc). Reviewers: zturner, emaste Subscribers: llvm-commits, sas Differential Revision: http://reviews.llvm.org/D16488 Change by Francis Ricci <fjricci@fb.com> llvm-svn: 259433
* Always write the session file in UTF-8.Zachary Turner2016-02-013-3/+5
| | | | | | | | | | | | | | | | | | This patch attempts to solve the Python 2 / Python 3 incompatibilities by introducing a new `encoded_file` abstraction that we use instead of `io.open()`. The problem with the builtin implementation of `io.open` is that `read` and `write` accept and return `unicode` objects, which are not always convenient to work with in Python 2. We solve this by making `encoded_file.open()` return the same object returned by `io.open()` but with hooked `read()` and `write()` methods. These hooked methods will accept binary or text data, and conditionally convert what it gets to a `unicode` object using the correct encoding. When calling `read()` it also does any conversion necessary to convert the output back into the native `string` type of the running python version. Differential Revision: http://reviews.llvm.org/D16736 llvm-svn: 259379
* Fix misnamed variable in TestProcessAPI.pyZachary Turner2016-02-011-2/+2
| | | | llvm-svn: 259378
* Remove flaky annotation for TestCallWithTimeout on linuxPavel Labath2016-02-011-1/+0
| | | | | | The test has passed last 100 runs of the buildbot. llvm-svn: 259368
* Set correct ThreadStopInfo in case of trace eventAbhishek Aggarwal2016-02-012-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: - The patch solves Bug 23478 and Bug 19311. Resolving Bug 23478 also resolves Bug 23039. Correct ThreadStopInfo is set for Linux and FreeBSD platforms. - Summary: When a trace event is reported, we need to check whether the trace event lands at a breakpoint site. If it lands at a breakpoint site then set the thread's StopInfo with the reason 'breakpoint'. Else, set the reason to be 'Trace'. Change-Id: I0af9765e782fd74bc0cead41548486009f8abb87 Signed-off-by: Abhishek Aggarwal <abhishek.a.aggarwal@intel.com> Reviewers: jingham, emaste, lldb-commits, clayborg, ovyalov Subscribers: emaste Differential Revision: http://reviews.llvm.org/D16720 llvm-svn: 259344
* Fix this test for the the switch in default for IgnoreBreakpoints in ↵Jim Ingham2016-01-291-1/+6
| | | | | | SBFrame.EvaluateExpression. llvm-svn: 259234
* Fix crash in lldb-mi when stack variable name is nullptr. This always ↵Eugene Leviant2016-01-292-0/+28
| | | | | | happens when execution stops in try scope with unnamed catch clause llvm-svn: 259189
* Fix a bug where type <formatter> list would ignore the -w argumentEnrico Granata2016-01-291-0/+4
| | | | | | rdar://24379879 llvm-svn: 259135
* Fix a bug where LLDB would not print the name of the function that a ↵Enrico Granata2016-01-296-0/+92
| | | | | | | | scripted summary is bound to rdar://24380076 llvm-svn: 259131
* Fix an issue where the type <formatter> list command would not accept a ↵Enrico Granata2016-01-281-0/+26
| | | | | | | | valid argument and instead error out complaining about a malformed regex rdar://problem/24380025 llvm-svn: 259078
* Revert "Resubmit r258759 with proper unicode handling."Zachary Turner2016-01-272-2/+3
| | | | | | This reverts commit 2c79d60214e146b13b233392a859b4f79340e90e. llvm-svn: 258978
* Resubmit r258759 with proper unicode handling.Zachary Turner2016-01-272-3/+2
| | | | | | | | | Instead of opening the file in unicode mode, we need only encode data which potentially has non-ASCII characters as UTF8 before writing. This should work across both Python versions, and is also far simpler than anything else discussed. llvm-svn: 258969
* Fix some python 3 incompatibilities that went in overnight.Zachary Turner2016-01-272-2/+4
| | | | | | | | * basestring is not a thing anymore. Must use `six.string_types`. * Must use from __future__ import print_function in every new test file. llvm-svn: 258967
* Refactor some of the xfail / skip decorators to share logic.Zachary Turner2016-01-274-74/+122
| | | | | | | | | | | Previously the logic of skipIf and expectedFailure were 99% the same, but they took different sets of arguments since they were maintained separately, and had slightly differences in their behavior. This makes everything consistent, there is now only one real implementation, and the previous ones are changed to use the single master implementation. llvm-svn: 258966
* Don't automtically try to import pexpect in lldbpexpect.Zachary Turner2016-01-271-45/+51
| | | | | | | | | | Since pexpect doesn't exist on Windows, tests which are xfail'ed are not being run at all because they are failing when the file is imported due to the `import pexpect`. This puts the import behind a conditional and makes an empty base class in the case where pexpect is not present. llvm-svn: 258965
* XFail TestCPPAuto on Windows until we can find the root problem.Adrian McCarthy2016-01-271-0/+1
| | | | | | llvm.org/pr26339 llvm-svn: 258943
* Decorarte TestInferiorAssert xfails on AArch64 LinuxOmair Javaid2016-01-271-3/+3
| | | | | | This patch decorates some of TestInferiorAssert test cases with expectedFailureLinux on AArch64. llvm-svn: 258930
* [LLDB][MIPS] A small fix in GetBreakableLoadAddress() for MIPSBhushan D. Attarde2016-01-274-4/+120
| | | | | | | | | | | | | SUMMARY: Get the load address for the address given by symbol and function. Earlier, this was done for function only, this patch does it for symbol too. This patch also adds TestAvoidBreakpointInDelaySlot.py to test this change. Reviewers: clayborg Subscribers: labath, zturner, mohit.bhakkad, sagar, jaydeep, lldb-commits Differential Revision: http://reviews.llvm.org/D16049 llvm-svn: 258919
* Reverting r258759 as it is breaking the OSX buildEnrico Granata2016-01-262-1/+2
| | | | llvm-svn: 258791
* Fix TestRerun.py on Windows.Zachary Turner2016-01-261-25/+6
| | | | | | | | This is another example of a test that was looking for the thread at index 0 instead of requesting the thread that was stopped at the created breakpoint. This assumption isn't true on Windows 10. llvm-svn: 258764
* Fix the lldbinline tests so they make well-formed Makefiles.Sean Callanan2016-01-261-1/+1
| | | | | | | | | lldbinline tests previously did not run correctly unless there was already a Makefile for them. This was because the syntax of the emitted Makefile made the default make rule be the "cleanup" rule, which is pretty unhelpful. Now the default rule is the one included from Makefile.rules, which is much better. llvm-svn: 258763
* Remove XFAIL Windows from a test that was fixed by r258758.Zachary Turner2016-01-261-1/+0
| | | | llvm-svn: 258761
* Write the session log file in UTF-8.Zachary Turner2016-01-262-2/+1
| | | | | | | | | | | Previously we were writing in the default encoding, which depends on the operating system and is not guaranteed to be unicode aware. On Python 3, this would lead to a situation where writing unicode text to the log file generates an exception. The fix here is to write session logs using the proper encoding, which incidentally fixes another test, so xfail is removed from that. llvm-svn: 258759
OpenPOWER on IntegriCloud