summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test
Commit message (Collapse)AuthorAgeFilesLines
* Introduce a setting to disable Spotlight while running the test suiteAdrian Prantl2018-03-121-1/+6
| | | | | | | | | | | This is a more principled approach to disabling Spotlight .dSYM lookups while running the testsuite, most importantly it also works for the LIT-based tests, which I overlooked in my initial fix (renaming the test build dir to lldb-tests.noindex). Differential Revision: https://reviews.llvm.org/D44342 llvm-svn: 327330
* Rename clang.modules-cache-path to symbols.clang-modules-cache-pathAdrian Prantl2018-03-102-2/+2
| | | | | | | | I want to extend the properties on ModuleList to also contain other more general settings and renaming the settings category to symbols seems to be the least bad of choices. llvm-svn: 327193
* Make TestCompletion work on windowsPavel Labath2018-03-091-58/+0
| | | | | | | | | | | The test I added in r327110 is failing on windows because of "import pexpect". However, this import is no longer necessary as these tests don't use pexpect anymore. In fact, it seems that all TestCompletion tests are passing on windows after this, so I enable all of them. llvm-svn: 327133
* Move option parsing out of the Args classPavel Labath2018-03-091-26/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The args class is used in plenty of places (a lot of them in the lower lldb layers) for representing a list of arguments, and most of these places don't care about option parsing. Moving the option parsing out of the class removes the largest external dependency (there are a couple more, but these are in static functions), and brings us closer to being able to move it to the Utility module). The new home for these functions is the Options class, which was already used as an argument to the parse calls, so this just inverts the dependency between the two. The functions are themselves are mainly just copied -- the biggest functional change I've made to them is to avoid modifying the input Args argument (getopt likes to permute the argument vector), as it was weird to have another class reorder the entries in Args class. So now the functions don't modify the input arguments, and (for those where it makes sense) return a new Args vector instead. I've also made the addition of a "fake arg0" (required for getopt compatibility) an implementation detail rather than a part of interface. While doing that I noticed that ParseForCompletion function was recording the option indexes in the shuffled vector, but then the consumer was looking up the entries in the unshuffled one. This manifested itself as us not being able to complete "watchpoint set variable foo --" (because getopt would move "foo" to the end). Surprisingly all other completions (e.g. "watchpoint set variable foo --w") were not affected by this. However, I couldn't find a comprehensive test for command argument completion, so I consolidated the existing tests and added a bunch of new ones. Reviewers: davide, jingham, zturner Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D43837 llvm-svn: 327110
* [test] Skip a test which sporadically fails in its dsym variantVedant Kumar2018-03-091-0/+2
| | | | | | | | There is a mailing list discussion re: r325927 about why this test fails in the dsym variant. I've marked it skipped for now, until the issue is resolved. llvm-svn: 327089
* [test] Skip a test when using an out-of-tree debugserverVedant Kumar2018-03-085-0/+18
| | | | | | | | | | | | | | | | | | | | The test "test_fp_special_purpose_register_read" in TestRegisters.py fails on Darwin machines configured to use an out-of-tree debugserver. The error message is: 'register read ftag' returns expected result, got 'ftag = 0x80'. This indicates that the debugserver in use is too old. This commit introduces a decorator which can be used to skip tests which rely on having a just-built debugserver. This resolves the issue: $ ./bin/llvm-dotest -p TestRegisters.py -v 1 out of 617 test suites processed - TestRegisters.py Test Methods: 7 Success: 6 Skip: 1 ... llvm-svn: 327052
* [LLDB][PPC64] Fix single step and LldbGdbServer testsPavel Labath2018-03-083-6/+11
| | | | | | | | | | | | | | | | | | Summary: On PPC64, the tested functions were being entered through their local entry point, while the tests expected the program to stop at the function start address, that, for PPC64, corresponds to the global entry point. To fix the issue, the test program was modified to call the functions to be tested through function pointers, which, on PPC64, force the calls through the global entry point, while not affecting the test on other platforms. Reviewers: clayborg, labath Reviewed By: labath Subscribers: alexandreyy, lbianc Differential Revision: https://reviews.llvm.org/D43768 Patch by Leandro Lupori <leandro.lupori@gmail.com>. llvm-svn: 327013
* Add test for lldb-mi interpreterAdrian Prantl2018-03-062-0/+39
| | | | | | | | | | Test that "lldb-mi --interpreter" can interpret "target list" CLI command. Patch by Alex Polyakov! Differential Revision: https://reviews.llvm.org/D44040 llvm-svn: 326847
* Rewrite TestTargetSymbolsBuildidCase to be more focusedPavel Labath2018-03-063-45/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The test was failing in remote debugging scenario with windows as a host as cmd.exe is not able to parse the complicated shell commands in the Makefile. The test seemed like a perfect candidate for a more focused testing approach, so I have rewritten in on top of lldb-test's module-sections functionality. The slight gotcha there was that the Module::GetSectionList does not include the sections from the symbol file until someone manually calls Module::GetSymbolVendor. Normally, this is not an issue, because someone will have initialized the symbol vendor by the time anyone starts looking at the sections. However, when all one this is dump the section list, we run into this problem. I've tried making this behavior more automatic, but it turns out it's not that easy, so for now, I just manually initialize the Symbol Vendor before dumping out the sections in lldb-test. Reviewers: jankratochvil Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D42914 llvm-svn: 326805
* [LLDB][PPC64] Fixed issues with expedited registersPavel Labath2018-03-061-0/+2
| | | | | | | | | | | | | | | | | Summary: - reg_nums were missing the end marker entry - marked FP test to be skipped for ppc64 Reviewers: labath, clayborg Reviewed By: labath, clayborg Subscribers: alexandreyy, lbianc, nemanjai, kbarton Differential Revision: https://reviews.llvm.org/D43767 Patch by Leandro Lupori <leandro.lupori@gmail.com> llvm-svn: 326775
* Upstreaming avx512 register support in debugserver. These changesJason Molenda2018-03-064-19/+241
| | | | | | | | | | | | | | | | | | | were originally written by Chris Bieneman, they've undergone a number of changes since then. Also including the debugserver bridgeos support, another arm environment that runs Darwin akin to ios. These codepaths are activated when running in a bridgeos environment which we're not set up to test today. There's additional (small) lldb changes to handle bridgeos binaries that still need to be merged up. Tested on a darwin system with avx512 hardware and without. <rdar://problem/36424951> llvm-svn: 326756
* [test] Skip pexpect-based lldb-mi tests on DarwinVedant Kumar2018-03-054-1/+20
| | | | | | | | | | | | | | | These tests fail with a relatively frequently on Darwin machines with errors such as: File ".../lldb/third_party/Python/module/pexpect-2.4/pexpect.py", line 1444, in expect_loop raise EOF(str(e) + '\n' + str(self)) EOF: End Of File (EOF) in read_nonblocking(). Empty string style platform. The unpredictable failures make these tests noisy. rdar://37046976 llvm-svn: 326739
* Including <functional> for std::bindRaphael Isemann2018-03-051-0/+1
| | | | | | Differential Revision: https://reviews.llvm.org/D44099 llvm-svn: 326727
* Mark ObjC testcase as skipUnlessDarwin and fix a typo in test function.Adrian Prantl2018-03-021-1/+2
| | | | llvm-svn: 326640
* Don't compile testcase with clang modules enabled.Adrian Prantl2018-03-022-2/+1
| | | | | | | It isn't actually necessary for what we are testing here and should fix the test on the Linux bots. llvm-svn: 326634
* Make the clang module cache setting available without a targetAdrian Prantl2018-03-026-2/+55
| | | | | | | | | | | | | | | It turns out that setting the clang module cache after LLDB has a Target can be too late. In particular, the Swift language plugin needs to know the setting without having access to a Target. This patch moves the setting into the *LLDB* module cache, where it is a global setting that is available before any Target is created and more importantly, is shared between all Targets. rdar://problem/37944432 Differential Revision: https://reviews.llvm.org/D43984 llvm-svn: 326628
* [testsuite] Remove workaround for categories and inline tests.Jonas Devlieghere2018-03-021-9/+6
| | | | | | | | | | | | | | | | Adding categories to inline tests does not work because the attribute is set at the function level. For methods, this means it applies to all instances of that particular class. While this is what we want in most cases, it's not for inline tests, where different instances correspond to different tests. With the workaround in place, assigning a category to one test resulted in the category applied to *all* inline tests. This patch removes the workaround and throws an exception with an informative error message, to prevent this from happening in the future. llvm-svn: 326552
* Speed up TestWatchpointMultipleThreadsPavel Labath2018-03-022-120/+41
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: The inferior was sleeping before doing any interesting work. I remove that to make the test faster. While looking at the purpose of the test (to check that watchpoints are propagated to all existing threads - r140757) I noticed that the test has diverged from the original intention and now it creates the threads *after* the watchpoint is set (this probably happened during the std::thread refactor). After some discussion, we decided both scenarios make sense, so I modify the test to test both. The watchpoint propagation functionality is not really debug info depenent, so I also stop replication of this test. This brings the test's time from ~108s down to 4s. Reviewers: davide, jingham Subscribers: aprantl, lldb-commits Differential Revision: https://reviews.llvm.org/D43857 llvm-svn: 326514
* Make TestDynamicValueSameBase gcc-compatiblePavel Labath2018-03-011-3/+7
| | | | | | | | | | gcc will say that the type of "this" is "T * const", clang "T *". Compare the unqualified type names to erase the difference between the two, as the constness is not a part of this test. FWIW, I think that the gcc behavior makes more sense here. llvm-svn: 326449
* [test] Restore cleanup behavior in TestQuoting.pyVedant Kumar2018-03-011-1/+1
| | | | | | | | | | Before the change to compile tests out-of-tree, the cleanup classmethod in TestQuoting.py would remove a temp file. After the change it threw an exception due to a malformed call to getBuildArtifact(). Bring back the old behavior. llvm-svn: 326414
* We were getting the wrong dynamic type if there were two classes with the ↵Jim Ingham2018-03-013-0/+99
| | | | | | | | | | | | | | same basename. There's a bug in FindTypes, it ignores the exact flag if you pass a name that doesn't begin with :: and pass eTypeClassAny for the type. In this case we always know that the name we get from the vtable name is absolute so we can work around the bug by prepending the "::". This doesn't fix the FindTypes bug. <rdar://problem/38010986> llvm-svn: 326412
* Adapt some tests to work with PPC64le architecturePavel Labath2018-02-284-4/+7
| | | | | | | | | | | | | | | Summary: Merge branch 'master' into adaptPPC64tests Reviewers: clayborg, alexandreyy, labath Reviewed By: clayborg, alexandreyy Subscribers: luporl, lbianc, alexandreyy, lldb-commits Differential Revision: https://reviews.llvm.org/D42917 Patch by Ana Julia Caetano <ana.caetano@eldorado.org.br>. llvm-svn: 326369
* Revert "[lldb] Use vFlash commands when writing to target's flash memory ↵Pavel Labath2018-02-281-61/+0
| | | | | | | | | | | | regions" This reverts commit r326261 as it introduces inconsistencies in the handling of load addresses for ObjectFileELF -- some parts of the class use physical addresses, and some use virtual. This has manifested itself as us not being able to set the load address of the vdso "module" on android. llvm-svn: 326367
* Fix lldbinline tests for remote targetsPavel Labath2018-02-271-1/+1
| | | | | | | | | | r326140 exposed the fact that we are not actually running inline tests on remote targets. The tests fail to launch the inferior in the first place because they passed an invalid working directory to the launch function. This should fix that. llvm-svn: 326264
* [lldb] Use vFlash commands when writing to target's flash memory regionsPavel Labath2018-02-271-0/+61
| | | | | | | | | | | | | | | | | | | | | | Summary: When writing an object file over gdb-remote, use the vFlashErase, vFlashWrite, and vFlashDone commands if the write address is in a flash memory region. A bare metal target may have this kind of setup. - Update ObjectFileELF to set load addresses using physical addresses. A typical case may be a data section with a physical address in ROM and a virtual address in RAM, which should be loaded to the ROM address. - Add support for querying the target's qXfer:memory-map, which contains information about flash memory regions, leveraging MemoryRegionInfo data structures with minor modifications - Update ProcessGDBRemote to use vFlash commands in DoWriteMemory when the target address is in a flash region Original discussion at http://lists.llvm.org/pipermail/lldb-dev/2018-January/013093.html Reviewers: clayborg, labath Reviewed By: labath Subscribers: arichardson, emaste, mgorny, lldb-commits Differential Revision: https://reviews.llvm.org/D42145 Patch by Owen Shaw <llvm@owenpshaw.net> llvm-svn: 326261
* Move TestGdbRemoteExitCode next to the other llgs testsPavel Labath2018-02-273-363/+0
| | | | | | | This test contained a copy of the inferior used by most of llgs test. This was done to enable better paralelization, but now it's irrelevant. llvm-svn: 326218
* Mark test_*int*_t_dwarf as failing on FreeBSDEd Maste2018-02-271-0/+9
| | | | | | | | | | | | Further investigation required; tests will be enabled on the buildbot worker soon. Marking failing tests for now in order to start with a green buildbot while investigation takes place. This is a recommit of r326134, with the required import added. llvm.org/pr36527 llvm-svn: 326166
* Move "concurrent events" tests back into one folderPavel Labath2018-02-2771-348/+4
| | | | | | | | | These tests all test very similar things, and use the same inferior. They were only placed in separate folders to achieve better paralelization. Now that we paralelize at a file level, this is no longer relevant, and we can put them together again. llvm-svn: 326159
* Add a sanity check for inline testcases.Adrian Prantl2018-02-262-0/+10
| | | | | | | | | | | When writing an inline test, there is no way to make sure that any of the inline commands are actually executed, so this patch adds a sanity check that at least one breakpoint was hit. This avoids a test with no breakpoints being hit passing. Differential Revision: https://reviews.llvm.org/D43694 llvm-svn: 326140
* Revert r326134 due to broken buildbotEd Maste2018-02-261-8/+0
| | | | llvm-svn: 326139
* Mark test_*int*_t_dwarf as failing on FreeBSDEd Maste2018-02-261-0/+8
| | | | | | | | | | Further investigation required; tests will be enabled on the buildbot worker soon. Marking failing tests for now in order to start with a green buildbot while investigation takes place. llvm.org/pr36527 llvm-svn: 326134
* Partial fix for TestConflictingSymbol.py on WindowsAdrian McCarthy2018-02-263-4/+4
| | | | | | | | | | | | | | | | | Without this fix, the test ERRORs because the link of the inferior fails. This patch adds the LLDB_TEST_API macro where needed and uses the new -2 magic value for num_expected_locations to account for lazy-loading of module symbols on Windows. With this fix, the test itself still fails: conflicting_symbol isn't in the debug info nor the export table, and Windows binaries don't have an equivalent of the ELF .symtab. We need to understand why the test works to keep the symbol out of the debug info. In the mean time, having the test fail at this point is a better indication of the remaining problem than a build error. Differential Revision: https://reviews.llvm.org/D43688 llvm-svn: 326130
* Add "lldb-test breakpoint" command and convert the case-sensitivity test to ↵Pavel Labath2018-02-263-143/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | use it Summary: The command takes two input arguments: a module to use as a debug target and a file containing a list of commands. The command will execute each of the breakpoint commands in the file and dump the breakpoint state after each one. The commands are expected to be breakpoint set/remove/etc. commands, but I explicitly allow any lldb command here, so you can do things like change setting which impact breakpoint resolution, etc. There is also a "-persistent" flag, which causes lldb-test to *not* automatically clear the breakpoint list after each command. Right now I don't use it, but the idea behind it was that it could be used to test more complex combinations of breakpoint commands (set+modify, set+disable, etc.). Right now the command prints out only the basic breakpoint state, but more information can be easily added there. To enable easy matching of the "at least one breakpoint location found" state, the command explicitly prints out the string "At least one breakpoint location.". To enable testing of breakpoints set with an absolute paths, I add the ability to perform rudimentary substitutions on the commands: right now the string %p is replaced by the directory which contains the command file (so, under normal circumstances, this will perform the same substitution as lit would do for %p). I use this command to rewrite the TestBreakpointCaseSensitivity test -- the test was checking about a dozen breakpoint commands, but it was launching a new process for each one, so it took about 90 seconds to run. The new test takes about 0.3 seconds for me, which is approximately a 300x speedup. Reviewers: davide, zturner, jingham Subscribers: luporl, lldb-commits Differential Revision: https://reviews.llvm.org/D43686 llvm-svn: 326112
* Fix tabs/spaces indentation problem in TestUnicodeSymbols.pyAdrian McCarthy2018-02-261-7/+7
| | | | | | Differential Revision: https://reviews.llvm.org/D43705 llvm-svn: 326095
* Fix breakpoint thread name conditionals after breakpoint options refactor.Jim Ingham2018-02-232-35/+29
| | | | | | PR36435 llvm-svn: 325958
* Replace HashStringUsingDJB with llvm::djbHashPavel Labath2018-02-233-0/+30
| | | | | | | | | | | | | | | | | | | | | | Summary: The llvm function is equivalent to this one. Where possible I tried to replace const char* with llvm::StringRef to avoid extra strlen computations. In most places, I was able to track the c string back to the ConstString it was created from. I also create a test that verifies we are able to lookup names with unicode characters, as a bug in the llvm compiler (it accidentally used a different hash function) meant this was not working until recently. This also removes the unused ExportTable class. Reviewers: aprantl, davide Subscribers: JDevlieghere, lldb-commits Differential Revision: https://reviews.llvm.org/D43596 llvm-svn: 325927
* Fix TestMultithreaded when there's no debugserver specifiedFrederic Riss2018-02-231-1/+1
| | | | | | | r325858 was bogus and would error out with a KeyError when --server was not passed to dotest.py. llvm-svn: 325862
* Fix TestUbsanBasicFrederic Riss2018-02-231-1/+1
| | | | | | | | | | | | | | | Summary: Potentially due to the recent testuite refactorings, this test now reports a full absolute path but expect just the filename. For some reason this test is skipped on GreenDragon so we've never seen the issue. Reviewers: vsk Subscribers: kubamracek, lldb-commits Differential Revision: https://reviews.llvm.org/D43577 llvm-svn: 325859
* Fix TestMultithreaded when specifying an alternative debugserver.Frederic Riss2018-02-231-0/+2
| | | | | | | | | | | | | Summary: This test launches a helper that uses the debugserver. The environment variable sepcifying the debug server wasn't passed to this helper, thus it was using the default one. Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D43546 llvm-svn: 325858
* [testsuite] Throw away test/debug_info/apple_types.Davide Italiano2018-02-233-104/+0
| | | | | | | | | | | | This test was only testing that clang produced the correct informations for __apple accelerated tables. So, it's a clang test. Also, it doesn't require any debugger intervention, the object file can be analyzed statically with a dumper. Also, the input program was highly verbose (unnecessarily). r325850 commits a clang test instead, so it's time to retire this. llvm-svn: 325851
* [ObjC] Fix the NSConcreteData formatter and test itVedant Kumar2018-02-222-2/+14
| | | | | | | The length field of an NSConcreteData lives one word past the start of the object, not two. llvm-svn: 325841
* Fix TestMoveNearest on WindowsAdrian McCarthy2018-02-221-3/+2
| | | | | | | | | | The header file for the DLL tried to declare inline functions and a local function as dllexport which broke the compile and link. Removing the bad declarations solves the problem, and the test passes on Windows now. Differential Revision: https://reviews.llvm.org/D43600 llvm-svn: 325836
* Fix TestSBData.py on WindowsAdrian McCarthy2018-02-221-1/+1
| | | | | | | | | Ensure that the test data is an array of bytes rather than a string that gets encoded differently between Python 2 and Python 3. Differential Revision: https://reviews.llvm.org/D43532 llvm-svn: 325835
* [testsuite/decorators] Get rid of some `expectFlakey` variants.Davide Italiano2018-02-211-27/+0
| | | | | | These seem to be pretty much dead. llvm-svn: 325708
* Fix TestBreakpointInGlobalConstructor for WindowsAdrian McCarthy2018-02-212-3/+5
| | | | | | | | | | | | | | | | | | Summary: This test was failing on Windows because it expected the breakpoint in the dynamic library to be resolved before the process is launched. Since the DLL isn't loaded until the process is launched this didn't work. The fix creates a special value (-2) for num_expected_locations that ignores the actual number of breakpoint locations found. Reviewers: jasonmolenda Subscribers: sanjoy, lldb-commits Differential Revision: https://reviews.llvm.org/D43419 llvm-svn: 325704
* Fix remote tests broken by r325690Pavel Labath2018-02-211-1/+1
| | | | | | | | The patch added an extra argument to the append_to_process_working_directory function. I have somehow missed updating this test, and it did not show up because the code was only run in remote mode. llvm-svn: 325702
* Fix a couple of more tests to not create files in the source treePavel Labath2018-02-217-28/+23
| | | | | | | | | | | | | | | | | | | | | | | | Summary: These were not being flaky, but they're still making the tree dirty. These tests were using lldbutil.append_to_process_working_directory to derive the file path so I fix them by modifying the function to return the build directory for local tests. Technically, now the path returned by this function does not point to the process working directory for local tests, but I think it makes sense to keep the function name, as I think we should move towards launching the process in the build directory (and I intend to change this for the handful of inferiors that actually care about their PWD, for example because they need to create files there). Reviewers: davide, aprantl Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D43506 llvm-svn: 325690
* Fix TestAppleTypesIsProduced after r324226Frederic Riss2018-02-211-1/+1
| | | | | | | | This test was accessing self.debug_info, which doesn't exist anymore. For some reason the macOS bots are skipping this test because they think the compiler is not clang. We'll look into this separately. llvm-svn: 325666
* Avoid dirtying the source tree in breakpoint command testsPavel Labath2018-02-204-92/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The paralelization patch exposed a bunch of cases where we were still touching the source tree (as these tests were now stepping on each others toes and being flaky). This patch removes such issues from breakpoint command tests. Since the only reason they were creating files was to indirectly test whether the breakpoint commands got executed (and plumbing the full build tree path to all places that needed it would be messy) I decided to modify the tests to check for a different side effect instead: modification of a global variable. This also makes the code simpler as checking the value of the global variable is easier, and there is nothing to clean up. As the tests aren't really doing anything debug-info related, I took the opportunity to also mark them as NO_DEBUG_INFO_TESTCASEs. Reviewers: jingham, aprantl Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D43464 llvm-svn: 325570
* Two more dosep-paralellization fallout fixesPavel Labath2018-02-191-32/+14
| | | | | | | | | | | | | | | | The first issue is about the flaky test rerun logic. This was grouping tests by subdir and passing them into walk_and_invoke in the incorrect form. This part can be just deleted as its not needed anymore. The second problem (which I noticed while investigating the first one) was that the "-p" switch was not working in multiprocessing mode. This happened because we were returning None from process_file instead of a tuple full of empty values for tests that did not match the -p regex. Both of these would be caught earlier if python was a more strongly typed language. :/ llvm-svn: 325519
OpenPOWER on IntegriCloud