aboutsummaryrefslogtreecommitdiff
path: root/lldb/packages/Python/lldbsuite/test/api
AgeCommit message (Collapse)AuthorFilesLines
2020-02-11[lldb][test] Remove symlink for API tests.Jordan Rupprecht28-1371/+0
Summary: Moves lldbsuite tests to lldb/test/API. This is a largely mechanical change, moved with the following steps: ``` rm lldb/test/API/testcases mkdir -p lldb/test/API/{test_runner/test,tools/lldb-{server,vscode}} mv lldb/packages/Python/lldbsuite/test/test_runner/test lldb/test/API/test_runner for d in $(find lldb/packages/Python/lldbsuite/test/* -maxdepth 0 -type d | egrep -v "make|plugins|test_runner|tools"); do mv $d lldb/test/API; done for d in $(find lldb/packages/Python/lldbsuite/test/tools/lldb-vscode -maxdepth 1 -mindepth 1 | grep -v ".py"); do mv $d lldb/test/API/tools/lldb-vscode; done for d in $(find lldb/packages/Python/lldbsuite/test/tools/lldb-server -maxdepth 1 -mindepth 1 | egrep -v "gdbremote_testcase.py|lldbgdbserverutils.py|socket_packet_pump.py"); do mv $d lldb/test/API/tools/lldb-server; done ``` lldb/packages/Python/lldbsuite/__init__.py and lldb/test/API/lit.cfg.py were also updated with the new directory structure. Reviewers: labath, JDevlieghere Tags: #lldb Differential Revision: https://reviews.llvm.org/D71151
2020-02-07Add a test for adding and removing Listeners from a BroadcasterManager.Jim Ingham1-8/+76
Reid found a bug in removing Listeners from a BroadcasterManager: https://reviews.llvm.org/D74010 The bug didn't affect the case where there was only one Listener signed up for a BroadcasterManager, which was all the extant test case tests. The driver also only uses one listener (the debugger) for everything, so neither the test nor anything you do with lldb command line would have triggered the bug. This adds a couple more tests using more listeners, and adding and removing them in a different way, which triggers a separate code path.
2020-02-07[lldb] Remove all 'clean' targets from test MakefilesRaphael Isemann1-3/+0
Summary: To my knowledge we don't actually use or need these rules. And if we need them then there is probably a better way to implement this than having all these random regexes. Reviewers: labath, JDevlieghere Reviewed By: labath, JDevlieghere Subscribers: jingham, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D74126
2019-12-26[lldb][NFC] Simplify if-returnTatyana Krasnukha1-3/+1
2019-12-13[lldb][NFC] Remove all `setUp` overrides that only call the parent ↵Raphael Isemann1-4/+0
implementation Summary: A lot of our tests copied the setUp code from our TestSampleTest.py: ``` def setUp(self): # Call super's setUp(). TestBase.setUp(self) ``` This code does nothing unless we actually do any setUp work in there, so let's remove all these method definitions. Reviewers: labath, JDevlieghere Reviewed By: labath Subscribers: lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D71454
2019-12-13[lldb][NFC] Remove 'from __future__ import print_function' from all tests ↵Raphael Isemann1-1/+0
that don't actually call 'print()' Summary: A lot of tests do this trick but the vast majority of them don't even call `print()`. Most of this patch was generated by a script that just looks at all the files and deletes the line if there is no `print (` or `print(` anywhere else in the file. I checked the remaining tests manually and deleted the import if we never call print (but instead do stuff like `expr print(...)` and similar false-positives). I also corrected the additional empty lines after the import in the files that I manually edited. Reviewers: JDevlieghere, labath, jfb Reviewed By: labath Subscribers: dexonsmith, wuzish, nemanjai, kbarton, christof, arphaman, abidh, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D71452
2019-10-04[lldb] [testsuite] Mark TestSBCommandReturnObject as failing on WindowsJan Kratochvil1-0/+3
Filed: testsuite: TestSBCommandReturnObject: object has no attribute 'dylibPath' https://bugs.llvm.org/show_bug.cgi?id=43570 http://lab.llvm.org:8011/builders/lldb-x64-windows-ninja/builds/9530/steps/test/logs/stdio AttributeError: 'TestSBCommandReturnObject' object has no attribute 'dylibPath' Fix crash on SBCommandReturnObject & assignment https://reviews.llvm.org/D67589 env = {self.dylibPath: self.getLLDBLibraryEnvVal()} I do not know how to link with liblldb on Windows so marking it as failing on Windows. llvm-svn: 373787
2019-10-04[lldb] Fix crash on SBCommandReturnObject & assignmentJan Kratochvil3-0/+69
I was writing an SB API client and it was crashing on: bool DoExecute(SBDebugger dbg, char **command, SBCommandReturnObject &result) { result = subcommand(dbg, "help"); That is because SBCommandReturnObject &result gets initialized inside LLDB by: bool DoExecute(Args &command, CommandReturnObject &result) override { // std::unique_ptr gets initialized here from `&result`!!! SBCommandReturnObject sb_return(&result); DoExecute(...); sb_return.Release(); Differential revision: https://reviews.llvm.org/D67589 llvm-svn: 373775
2019-09-27Revert: [lldb] [testsuite] Remove redundant MAKE_DSYM := NOJan Kratochvil2-0/+4
Revert: llvm-svn: 373061 It broke OSX testsuite: https://reviews.llvm.org/D67589#1686150 lldb/packages/Python/lldbsuite/test/macosx/function-starts/TestFunctionStarts.py llvm-svn: 373110
2019-09-27[lldb] [testsuite] Remove redundant MAKE_DSYM := NOJan Kratochvil2-4/+0
According to a comment by Pavel Labath: https://reviews.llvm.org/D67589#inline-612375 llvm-svn: 373061
2019-09-18Fir TestAPILog for gccPavel Labath1-7/+5
different compilers will put different things into __PRETTY_FUNCTION__. For instance gcc will not put a " " in the "const char *" argument, causing our regex matching to fail. This patch relaxes the regexes in this test to account for this difference. llvm-svn: 372224
2019-09-16[test] Fail gracefully if the regex doesn't matchJonas Devlieghere1-6/+11
This test is failing on the Fedora bot (staging). Rather than failing with an IndexError, we should trigger an assert and dump the log when the regex doesn't match. llvm-svn: 372052
2019-09-13[test] Update TestAPILog to pass on Windows.Jonas Devlieghere1-2/+2
The pretty function macro is including __cdecl on Windows, which was causing the pattern matching to fail. This should fix that. llvm-svn: 371905
2019-09-13[test] Print the log output on failure.Jonas Devlieghere1-2/+2
This ensures that if the assertion fails we dump the log content. This should help me investigate what the output looks like on Windows, where the test is failing. llvm-svn: 371899
2019-09-13[Reproducer] Include the this pointer in the API log.Jonas Devlieghere1-0/+48
The new centralized way of doing API logging through the reproducer macros is lacking a way to easily correlate instances of API objects. Logging the this pointer makes that significantly easier. For methods this is now always passed as the first argument, similar to the self argument in Python. This patch also adds a test case for API logging, which uncovered that we were not quoting strings. Differential revision: https://reviews.llvm.org/D67538 llvm-svn: 371885
2019-09-04[dotest] Avoid the need for LEVEL= makefile boilerplatePavel Labath5-15/+5
Summary: Instead of each test case knowing its depth relative to the test root, we can just have dotest add the folder containing Makefile.rules to the include path. This was motivated by r370616, though I have been wanting to do this ever since we moved to building tests out-of-tree. The only manually modified files in this patch are lldbinline.py and plugins/builder_base.py. The rest of the patch has been produced by this shell command: find . \( -name Makefile -o -name '*.mk' \) -exec sed --in-place -e '/LEVEL *:\?=/d' -e '1,2{/^$/d}' -e 's,\$(LEVEL)/,,' {} + Reviewers: teemperor, aprantl, espindola, jfb Subscribers: emaste, javed.absar, arichardson, christof, arphaman, lldb-commits Differential Revision: https://reviews.llvm.org/D67083 llvm-svn: 370845
2019-08-02[lldb][NFC] Remove unused imports in python testsRaphael Isemann5-15/+0
llvm-svn: 367663
2019-07-29[lldb] Increase testsuite packet-timeout 5secs -> 1minJan Kratochvil1-0/+2
rL357954 did increase `packet-timeout` 1sec -> 5secs. Which is IMO about the maximum timeout reasonable for regular use. But for testsuite I think the timeout should be higher as the testsuite runs in parallel and it can be run even on slow hosts and with other load (moreover if it runs on some slow arch). I have chosen 60 secs, that should be enough hopefully. Larger value could make debugging with hanging `lldb-server` annoying. This patch was based on this testsuite timeout: http://lab.llvm.org:8014/builders/lldb-x86_64-fedora/builds/546/steps/test/logs/stdio FAIL: test_connect (TestGDBRemoteClient.TestGDBRemoteClient) Test connecting to a remote gdb server ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/jkratoch/slave-lldb-x86_64-fedora/lldb-x86_64-fedora/llvm/tools/lldb/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/TestGDBRemoteClient.py", line 13, in test_connect process = self.connect(target) File "/home/jkratoch/slave-lldb-x86_64-fedora/lldb-x86_64-fedora/llvm/tools/lldb/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/gdbclientutils.py", line 480, in connect self.assertTrue(error.Success(), error.description) AssertionError: False is not True : failed to get reply to handshake packet Differential Revision: https://reviews.llvm.org/D65271 llvm-svn: 367234
2019-06-17[lldb] [test] Extend D55859 symbols.enable-external-lookup=false for more ↵Jan Kratochvil1-0/+1
testcases D55859 <https://reviews.llvm.org/D55859> has no effect for some of the testcases so this patch extends it even for (all?) other testcases known to me. LLDB was failing when LLDB prints errors reading system debug infos (`*-debuginfo.rpm`, DWZ-optimized) which should never happen as LLDB testcases should not be affected by system debug infos. `lldb/packages/Python/lldbsuite/test/api/multithreaded/driver.cpp.template` is using only SB API which does not expose `ModuleList` so I had to call `HandleCommand()` there. `lldb-test.cpp` could also use `HandleCommand` and then there would be no need for `ModuleListProperties::SetEnableExternalLookup()` but I think it is cleaner with API and not on based on text commands. Differential Revision: https://reviews.llvm.org/D63339 llvm-svn: 363567
2019-01-19Update the file headers across all of the LLVM projects in the monorepoChandler Carruth1-4/+3
to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
2018-12-18Skip TestMultithreaded.test_sb_api_listener_resume on linuxPavel Labath1-1/+1
The test still fails occasionally (1/100 runs). Upgrade the xfail to skip. llvm-svn: 349487
2018-07-27Fix whitespace in the python test suite.Raphael Isemann2-2/+2
Summary: The test suite has often unnecessary trailing whitespace, and sometimes unnecessary trailing lines or a missing final new line. This patch just strips trailing whitespace/lines and adds missing newlines at the end. Subscribers: ki.stfu, JDevlieghere, christof, lldb-commits Differential Revision: https://reviews.llvm.org/D49943 llvm-svn: 338171
2018-03-13[test] Replace some references to Apple-internal bugsVedant Kumar1-10/+2
This removes around 10 references to Apple-internal radars. I've filed fresh bugs on bugs.llvm.org as appropriate for open issues. llvm-svn: 327463
2018-02-23Fix TestMultithreaded when there's no debugserver specifiedFrederic Riss1-1/+1
r325858 was bogus and would error out with a KeyError when --server was not passed to dotest.py. llvm-svn: 325862
2018-02-23Fix TestMultithreaded when specifying an alternative debugserver.Frederic Riss1-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
2018-02-06Build each testcase variant in its own subdirectory and remove the srcdir ↵Adrian Prantl1-1/+1
lock file This patch creates a <test>.dwarf, <test>.dwo, etc., build directory for each testcase variant. Most importantly, this eliminates the need for the per-test lock file in the source directory. Tests that are marked as NO_DEBUG_INFO_TESTCASE and build with buildDefault() are built in a <test>.default build directory. Differential Revision: https://reviews.llvm.org/D42763 llvm-svn: 324368
2018-01-30Compile the LLDB tests out-of-tree.Adrian Prantl4-11/+15
This patch is the result of a discussion on lldb-dev, see http://lists.llvm.org/pipermail/lldb-dev/2018-January/013111.html for background. For each test (should be eventually: each test configuration) a separate build directory is created and we execute make VPATH=$srcdir/path/to/test -C $builddir/path/to/test -f $srcdir/path/to/test/Makefile -I $srcdir/path/to/test In order to make this work all LLDB tests need to be updated to find the executable in the test build directory, since CWD still points at the test's source directory, which is a requirement for unittest2. Although we have done extensive testing, I'm expecting that this first attempt will break a few bots. Please DO NOT HESITATE TO REVERT this patch in order to get the bots green again. We will likely have to iterate on this some more. Differential Revision: https://reviews.llvm.org/D42281 llvm-svn: 323803
2018-01-30Enforce that tests building with buildDefault set NO_DEBUG_INFO_TESTCASEAdrian Prantl2-0/+3
and fix resulting errors. This is a prerequisite for building each test variant in its own build directory. llvm-svn: 323789
2018-01-19Wrap all references to build artifacts in the LLDB testsuite (NFC)Adrian Prantl2-3/+3
in TestBase::getBuildArtifact(). This NFC commit is in preparation for https://reviews.llvm.org/D42281 (compile the LLDB tests out-of-tree). Differential Revision: https://reviews.llvm.org/D42280 llvm-svn: 323007
2017-03-10Mark this as skipped for now. There is a race condition withJason Molenda1-0/+1
SectionLoadList exposed by this test. Greg tried to chase it down & got pretty far but the isn't correct so we'll disable this test for now until I can figure that out. <rdar://problem/30899227> llvm-svn: 297440
2017-02-27Ah, this was an early exit to leave built products around, it wasn't meant toJason Molenda1-1/+0
be checked in. llvm-svn: 296412
2017-02-24Fix a race condition in FuncUnwinders where the mutex was beingJason Molenda2-0/+6
acquired only after checking if the ivar shared pointer was already filled in. But when I assign an UnwindPlan object to the shared pointer, I assign an empty object and then fill it in. That leaves a window where another thread could get the shared pointer to the empty (but quickly being-filled-in) object and lead to a crash. Also two changes from Greg for correctness on the TestMultipleDebuggers test case. <rdar://problem/30564102> llvm-svn: 296084
2017-02-02Fix multi-process-driver.cpp build on NetBSDKamil Rytarowski1-1/+1
Summary: Include <string.h> for strcmp(3) and memset(3). Sponsored by <The NetBSD Foundation> Reviewers: joerg, clayborg, emaste, labath Reviewed By: clayborg Subscribers: #lldb Tags: #lldb Differential Revision: https://reviews.llvm.org/D29403 llvm-svn: 293895
2016-12-21Ignore SIGPIPE in the mini-driver used by these tests.Jim Ingham1-0/+10
We're seeing some very occasional failures in these tests where the mini-driver dies with a SIGPIPE. We don't use SIGPIPE for anything, and the main lldb driver program already ignores SIGPIPE, so ignoring it in the mini-driver is a good way to remove these spurious failures. <rdar://problem/29740488> llvm-svn: 290216
2016-12-12Remove some annotations from TestMultipleTargetsPavel Labath1-8/+2
The test passes on linux. The i386 case is already handled by skipIfHostIncompatibleWithRemote. llvm-svn: 289427
2016-12-09Fix buildbots that are failing due to this test by adding all expected fails ↵Greg Clayton1-0/+9
that TestMultipleDebuggers.py has. llvm-svn: 289223
2016-12-09Rename multiple target test so it is unique.Greg Clayton1-1/+1
llvm-svn: 289222
2016-12-09Fix TestMultipleTargets for on x86_64 architecturesPavel Labath1-0/+2
This test links against liblldb, so it can only run when the target arch is the same arch as liblldb. We already have a decorator for that, so apply it. While I'm in there, also mark the test as debug-info independent. llvm-svn: 289199
2016-12-09Calling SBDebugger::CeeateTarget being called on multiple threads was ↵Greg Clayton3-0/+78
crashing LLDB. I found the race condition in: ScriptInterpreter *CommandInterpreter::GetScriptInterpreter(bool can_create); More than one "ScriptInterpreter *" was being returned due to the race which caused any clients with the first one to now be pointing to freed memory and we would quickly crash. Added a test to catch this so we don't regress. <rdar://problem/28356584> llvm-svn: 289169
2016-11-24Enable TestMultithreaded-sb_api_listener_event_process_state on linux/gccPavel Labath1-8/+0
Passing consistently now. llvm-svn: 287885
2016-10-31[Test Suite] Pull generateSource into lldbtestChris Bieneman9-49/+16
Summary: Convert tests using LLDB headers to use generateSource to put the right include paths in place regardless of whether or not you're building a framework. This also abstracted generateSource out of TestPublicAPIHeaders.py into lldbtest.py. Reviewers: tfiala, zturner Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D25887 llvm-svn: 285542
2016-10-27Revert "[Test Suite] Pull generateSource into lldbtest"Chris Bieneman9-16/+49
This reverts commit r285357. I committed this patch accidentally out of order. Will recommit when the change this depends on is landed. llvm-svn: 285361
2016-10-27[Test Suite] Pull generateSource into lldbtestChris Bieneman9-49/+16
Summary: Convert tests using LLDB headers to use generateSource to put the right include paths in place regardless of whether or not you're building a framework. This also abstracted generateSource out of TestPublicAPIHeaders.py into lldbtest.py. Reviewers: tfiala, zturner Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D25887 llvm-svn: 285357
2016-09-13Reduce the number of simultaneous debug sessions to 10 and removeJason Molenda2-2/+1
the expectedFlakeyDarwin annotation. I've been running this test in isolation on my macOS Sierra system and haven't seen a failure in 20-30 runs. The number of simultaneous debug sessions that it spins up could be a problem when the testbots are running under load, so I'm reducing this from 20 simultaneous debug sessions to see if we can get enough stability to leave this enabled. llvm-svn: 281291
2016-09-06*** This commit represents a complete reformatting of the LLDB source codeKate Stone4-46/+97
*** to conform to clang-format’s LLVM style. This kind of mass change has *** two obvious implications: Firstly, merging this particular commit into a downstream fork may be a huge effort. Alternatively, it may be worth merging all changes up to this commit, performing the same reformatting operation locally, and then discarding the merge for this particular commit. The commands used to accomplish this reformatting were as follows (with current working directory as the root of the repository): find . \( -iname "*.c" -or -iname "*.cpp" -or -iname "*.h" -or -iname "*.mm" \) -exec clang-format -i {} + find . -iname "*.py" -exec autopep8 --in-place --aggressive --aggressive {} + ; The version of clang-format used was 3.9.0, and autopep8 was 1.2.4. Secondly, “blame” style tools will generally point to this commit instead of a meaningful prior commit. There are alternatives available that will attempt to look through this change and find the appropriate prior commit. YMMV. llvm-svn: 280751
2016-08-23Fix API usage in TestMultithreaded.test_sb_api_listener_event_process_statePavel Labath1-0/+5
The test was attempting to backtrace a process after every state change event (including the "running", and "restarted" ones), which is not a good idea. llvm-svn: 279512
2016-05-11Rewriting TestMultithreaded.py to solve flakyness on LinuxRavitheja Addepally2-29/+18
Summary: test_listener_event_process_state checks for Threads and Frames in the multithreaded_queue. The listener_func has more computational load, which may be latter executed than the pop leading to the failure. This patch tries to only check for frames in listener_func as presence of frames also confirms prescence of threads and avoids the second push into the multithreaded_queue. Reviewers: lldb-commits, clayborg, labath Differential Revision: http://reviews.llvm.org/D20091 llvm-svn: 269168
2016-03-07Change over the broadcaster/listener process to hold shared or weak pointersJim Ingham3-0/+68
to each other. This should remove some infrequent teardown crashes when the listener is not the debugger's listener. Processes now need to take a ListenerSP, not a Listener&. This required changing over the Process plugin class constructors to take a ListenerSP, instead of a Listener&. Other than that there should be no functional change. <rdar://problem/24580184> CrashTracer: [USER] Xcode at …ework: lldb_private::Listener::BroadcasterWillDestruct + 39 llvm-svn: 262863
2016-02-10Remove expectedFailureLinux decorator.Zachary Turner1-1/+1
llvm-svn: 260422
2016-02-09Remove skip and xfail decorators for target architecture.Zachary Turner1-1/+1
This removes the following decorators: * skipIfI386 * expectedFailureI386 * expectedFailurex86_64 * skipIfArch * skipUnlessArch * skipUnlessI386 And other related decorators. All code using those decorators is updated to use expectedFailureAll and skipIf llvm-svn: 260178