summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test/lldbtest.py
Commit message (Collapse)AuthorAgeFilesLines
* [lldbtest] Remove some accidentally commented out code.Davide Italiano2019-02-201-2/+0
| | | | llvm-svn: 354415
* [lldbtest] Fix some code to be compatible between py2 and py3.Davide Italiano2019-02-181-18/+4
| | | | llvm-svn: 354297
* [dotest] Fix compiler version number comparisonFrederic Riss2019-02-141-4/+5
| | | | | | | | | | | | | | | dotest's version comparision function is just a lexicographical compare of the version strings. This is obviously wrong. This patch implements the comparison using distutils.version.LooseVersion as suggested by Zachary. Reviewers: zturner, labath, serge-sans-paille Subscribers: jdoerfert, lldb-commits Differential Revision: https://reviews.llvm.org/D58219 llvm-svn: 354047
* Only check the dwarf version when using the dwarf categoryAdrian Prantl2019-01-241-2/+2
| | | | llvm-svn: 352094
* Unbreak windows botsAdrian Prantl2019-01-241-9/+10
| | | | llvm-svn: 352086
* Add decorator support for the DWARF version produced by the compilerAdrian Prantl2019-01-241-0/+13
| | | | | | | and mark up some tests failing in http://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake-matrix/ llvm-svn: 352072
* Revert "[dotest] Add logging to investigate CI issue."Jonas Devlieghere2019-01-231-6/+1
| | | | | | | We figured out the issue so the logging is no longer necessary. It turns out we were using a session format that was not unique for inline tests. llvm-svn: 351902
* [dotest] Add logging to investigate CI issue.Jonas Devlieghere2019-01-181-1/+6
| | | | | | | | | | | | We're seeing an odd issue on GreenDragon's lldb-cmake-matrix. Dotest is unable to move a log file (OSError: [Errno 2] No such file or directory). The os.rename call is guarded with a check that the source file and destination directory exist. This wraps the call in a try-except that prints the source and destination path to see which component seemingly doesn't exist. llvm-svn: 351611
* lldbtest.py: try to fix a runtime exceptionAdrian Prantl2019-01-101-4/+7
| | | | | | found on http://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake-matrix/32/consoleFull#15046896708254eaf0-7326-4999-85b0-388101f2d404 llvm-svn: 350876
* Update a comment according to r255360 "Remove -r and -R options from dotest.py"Tatyana Krasnukha2018-12-141-2/+1
| | | | llvm-svn: 349208
* Use a shared module cache directory for LLDB.Adrian Prantl2018-11-161-2/+3
| | | | | | | | | | | | | This saves about 3 redundant gigabytes from the Objective-C test build directories. Tests that must do unsavory things with the LLDB clang module cache, already specify a per-test module cache in their .py test instructions. <rdar://problem/36002081> Differential Revision: https://reviews.llvm.org/D54602 llvm-svn: 347057
* Remove Go debugger pluginJonas Devlieghere2018-11-051-18/+0
| | | | | | | | | | | | | | | | | | | In January Davide sent an e-mail to the mailing list to suggest removing unmaintained language plugins such as Go and Java. The plan was to have some cool down period to allow users to speak up, however after that the plugins were never actually removed. This patch removes the Go debugger plugin. The plugin can be added again in the future if it is mature enough both in terms of testing and maintenance commitment. Discussion on the mailing list: http://lists.llvm.org/pipermail/lldb-dev/2018-January/013171.html Differential revision: https://reviews.llvm.org/D54057 llvm-svn: 346157
* [dotest] Make a missing FileCheck binary a warning, not an errorVedant Kumar2018-10-121-0/+2
| | | | | | | | | | This allows bots which haven't updated to pass in --filecheck to dotest.py to run more tests. FileCheck-dependent tests will continue to fail. Differential Revision: https://reviews.llvm.org/D53175 llvm-svn: 344401
* [lldbsuite] Fix the filecheck functionality to work with Python 3Stella Stamenova2018-10-121-1/+1
| | | | | | | | | | | | | | Summary: This is another string/byte conversion issue between Python 2 and 3. In Python 2, the subprocess communication expects a byte string, but in Python 3, it expects bytes. Since both versions are capable of using strings when universal_newlines is set to True AND filecheck operates on strings, force the use of strings. Reviewers: zturner, asmith, vsk Reviewed By: zturner Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D53166 llvm-svn: 344386
* [lldbtest] Fix self.filecheck check file lookupVedant Kumar2018-09-201-10/+11
| | | | | | | | | | | | | | The 'test_filename' property in TestBase changes over time, so attempting to find a check file relative to the directory containing 'test_filename' is flaky. Use the absolute path of the check file as that's always correct (and simpler). This relies on the test driver changing into the test directory, which it seems we can safely assume. As a drive-by, make self.filecheck respect the trace (-t) option. llvm-svn: 342699
* Allow use of self.filecheck in LLDB tests (c.f self.expect)Vedant Kumar2018-09-181-0/+48
| | | | | | | | | | | | | Add a "filecheck" method to the LLDB test base. This allows test authors to pattern match command output using FileCheck, making it possible to write stricter tests than what `self.expect` allows. For context (motivation, examples of stricter checking, etc), see the lldb-dev thread: "Using FileCheck in lldb inline tests". Differential Revision: https://reviews.llvm.org/D50751 llvm-svn: 342508
* Add support for descriptions with command completions.Raphael Isemann2018-09-131-0/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch adds a framework for adding descriptions to the command completions we provide. It also adds descriptions for completed top-level commands so that we can test this code. Completions are in general supposed to be displayed alongside the completion itself. The descriptions can be used to provide additional information about the completion to the user. Examples for descriptions are function signatures when completing function calls in the expression command or the binary name when providing completion for a symbol. There is still some boilerplate code from the old completion API left in LLDB (mostly because the respective APIs are reused for non-completion related purposes, so the CompletionRequest doesn't make sense to be used), so that's why I still had to change some function signatures. Also, as the old API only passes around a list of matches, and the descriptions are for these functions just another list, I had to add some code that essentially just ensures that both lists are always the same side (e.g. all the manual calls to `descriptions->AddString(X)` below a `matches->AddString(Y)` call). The initial command descriptions that come with this patch are just reusing the existing short help that is already added in LLDB. An example completion with descriptions looks like this: ``` (lldb) pl Available completions: platform -- Commands to manage and create platforms. plugin -- Commands for managing LLDB plugins. ``` Reviewers: #lldb, jingham Reviewed By: #lldb, jingham Subscribers: jingham, JDevlieghere, lldb-commits Differential Revision: https://reviews.llvm.org/D51175 llvm-svn: 342181
* Added initial code completion support for the `expr` commandRaphael Isemann2018-08-301-0/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch adds initial code completion support for the `expr` command. We now have a completion handler in the expression CommandObject that essentially just attempts to parse the given user expression with Clang with an attached code completion consumer. We filter and prepare the code completions provided by Clang and send them back to the completion API. The current completion is limited to variables that are in the current scope. This includes local variables and all types used by local variables. We however don't do any completion of symbols that are not used in the local scope (or in some other way already in the ASTContext). This is partly because there is not yet any code that manually searches for additiona information in the debug information. Another cause is that for some reason the existing code for loading these additional symbols when requested by Clang doesn't seem to work. This will be fixed in a future patch. Reviewers: jingham, teemperor Reviewed By: teemperor Subscribers: labath, aprantl, JDevlieghere, friss, lldb-commits Differential Revision: https://reviews.llvm.org/D48465 llvm-svn: 341086
* lldbtest.py: Unconditionally set the clang module cache path.Adrian Prantl2018-08-211-12/+9
| | | | | | This should fix the errors observable on the new lldb-cmake bot. llvm-svn: 340293
* Add a new tool named "lldb-vscode" that implements the Visual Studio Code ↵Greg Clayton2018-08-161-0/+5
| | | | | | | | | | | | Debug Adaptor Protocol This patch adds a new lldb-vscode tool that speaks the Microsoft Visual Studio Code debug adaptor protocol. It has full unit tests that test all packets. This tool can be easily packaged up into a native extension and used with Visual Studio Code, and it can also be used by Nuclide Differential Revision: https://reviews.llvm.org/D50365 llvm-svn: 339911
* Added missing null checks to fix r339351Raphael Isemann2018-08-091-1/+5
| | | | llvm-svn: 339353
* Also display the output and error output of a failed commandRaphael Isemann2018-08-091-1/+6
| | | | | | | | | | | | | | | | | Summary: Instead of just printing the current "False is not True, ..." message when we fail to run a certain command, this patch also adds the actual command output or error output that we received to the assertion message. Reviewers: davide Reviewed By: davide Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D50492 llvm-svn: 339351
* Add the actually calculated completions to COMPLETION_MSGRaphael Isemann2018-07-271-2/+3
| | | | | | | | | | Summary: Otherwise this assertion message is not very useful to whoever is reading the log. Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D49947 llvm-svn: 338179
* Fix whitespace in the python test suite.Raphael Isemann2018-07-271-5/+5
| | | | | | | | | | | | | 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
* [lit] Split test_set_working_dir TestProcessLaunch into two tests and fix it ↵Stella Stamenova2018-06-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | on Windows Summary: test_set_working_dir was testing two scenario: failure to set the working dir because of a non existent directory and succeeding to set the working directory. Since the negative case fails on both Linux and Windows, the positive case was never tested. I split the test into two which allows us to always run both the negative and positive cases. The positive case now succeeds on Linux and the negative case still fails. During the investigation, it turned out that lldbtest.py will try to execute a process launch command up to 3 times if the command failed. This means that we could be covering up intermittent failures by running any test that does process launch multiple times without ever realizing it. I've changed the counter to 1 (though it can still be overwritten with the environment variable). This change also fixes both the positive and negative cases on Windows. There were a few issues: 1) In ProcessLauncherWindows::LaunchProcess, the error was not retrieved until CloseHandle was possibly called. Since CloseHandle is also a system API, its success would overwrite any existing error that could be retrieved using GetLastError. So by the time the error was retrieved, it was now a success. 2) In DebuggerThread::StopDebugging TerminateProcess was called on the process handle regardless of whether it was a valid handle. This was causing the process to crash when the handle was LLDB_INVALID_PROCESS (0xFFFFFFFF). 3) In ProcessWindows::DoLaunch we need to check that the working directory exists before launching the process to have the same behavior as other platforms which first check the directory and then launch process. This way we also control the exact error string. Reviewers: labath, zturner, asmith, jingham Reviewed By: labath Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D48050 llvm-svn: 334642
* [LLDB] Unit tests basic support for OpenBSDDavid Carlier2018-06-041-15/+19
| | | | | | | | | | | | Add OpenBSD python module in order to support unit tests. Reviewers: labath, zturner Reviewed By: labath Differential Revision: https://reviews.llvm.org/D47692 llvm-svn: 333888
* [dotest] Make the set of tests independent of the test configurationPavel Labath2018-04-241-44/+8
| | | | | | | | | | | | | | | | | | | | | | | Summary: In the magic test duplicator, we were making the decision whether to create a test variant based on the compiler and the target platform. This meant that the set of known tests was different for each test configuration. This patch makes the set of generated test variants static and handles the skipping via runtime checks instead. This is more consistent with how we do other test-skipping decision (e.g. for libc++ tests), and makes it easier to expose the full set of tests to lit, which now does not need to know anything about what things can potentially cause tests to appear or disappear. Reviewers: JDevlieghere, aprantl Subscribers: eraman, lldb-commits Differential Revision: https://reviews.llvm.org/D45949 llvm-svn: 330708
* Fix some tests for PPC64le architecturePavel Labath2018-03-201-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: - Fix test jump for powerpc64le Jumping directly to the return line on power architecture dos not means returning the value that is seen on the code. The last test fails, because it needs the execution of some assembly in the beginning of the function. Avoiding this test for this architecture. - Avoid evaluate environ variable name on Linux On Linux the Symbol environ conflicts with another variable, then in order to avoid it, this test was moved into a specific test, which is not supported if the OS is Linux. - Added PPC64le as MIPS behavior Checking the disassembler output, on PPC64le machines behaves as MPIS. Added method to identify PPC64le architecture and checking it when disassembling instructions in the test case. Reviewers: labath Reviewed By: labath Subscribers: clayborg, labath, luporl, alexandreyy, sdardis, ki.stfu, arichardson Differential Revision: https://reviews.llvm.org/D44101 Patch by Leonardo Bianconi <leonardo.bianconi@eldorado.org.br>. llvm-svn: 327977
* [dotest] Clean up test folder clean-upPavel Labath2018-03-161-33/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch implements a unified way of cleaning the build folder of each test. This is done by completely removing the build folder before each test, in the respective setUp() method. Previously, we were using a combination of several methods, each with it's own drawbacks: - nuking the entire build tree before running dotest: the issue here is that this did not take place if you ran dotest manually - running "make clean" before the main "make" target: this relied on the clean command being correctly implemented. This was usually true, but not always. - for files which were not produced by make, each python file was responsible for ensuring their deleting, using a variety of methods. With this approach, the previous methods become redundant. I remove the first two, since they are centralized. For the other various bits of clean-up code in python files, I indend to delete it when I come across it. Reviewers: aprantl Subscribers: emaste, ki.stfu, mgorny, eraman, lldb-commits Differential Revision: https://reviews.llvm.org/D44526 llvm-svn: 327703
* [dotest] remove confirm_directory_exclusivity remnantsPavel Labath2018-03-151-13/+0
| | | | llvm-svn: 327643
* 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-101-1/+1
| | | | | | | | 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 the clang module cache setting available without a targetAdrian Prantl2018-03-021-2/+2
| | | | | | | | | | | | | | | 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
* Fix a couple of more tests to not create files in the source treePavel Labath2018-02-211-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | 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 paralelization of remote testsPavel Labath2018-02-161-1/+1
| | | | | | | | | | Since we now can run multiple tests from the same directory at once, we need to include the test name in the remote test directory instead. I'm not sure if the test_number in the remote path is necessary anymore (or even if it was ever necessary), but I choose to leave it in for now. llvm-svn: 325334
* [dosep] Run tests in a more parallel fashionPavel Labath2018-02-161-6/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Due to in-tree builds, we were parallelizing the tests at the directory level. Now that the tests are built out-of-tree, we can remove this limitation and paralelize at file level instead. This decreases test suite time by about 10% for me, which is not world-shattering, but it makes the code slightly simpler and will also allow us to merge tests which were artificially spread over multiple folders (TestConcurrentEvents...) to work-around this limitation. To make this work, I've also needed to include the test file name in the build directory name, as just the test method name is not unique enough (plenty of tests have a test method called "test" or similar). While doing this, I've found a couple of tests that are taking waaay longer then they ought to (TestBreakpointCaseSensitivity -- 90 seconds), which I plan to look into in the future. Reviewers: aprantl Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D43335 llvm-svn: 325322
* Make LLDB's clang module cache path customizableAdrian Prantl2018-02-091-0/+8
| | | | | | | | | | | This patch makes LLDB's clang module cache path customizable via settings set target.clang-modules-cache-path <path> and uses it in the LLDB testsuite to reuse the same location inside the build directory for LLDB and clang. Differential Revision: https://reviews.llvm.org/D43099 llvm-svn: 324775
* Only throw -fPIC when building a shared libraryAaron Smith2018-02-081-4/+4
| | | | | | | | | | | | | | | | | | Summary: Update makefiles to specify -fPIC in Makefile.rules and only throw -fPIC when building a shared library. This change is necessary to allow building the lldb tests on Windows where -fPIC is not a valid option. Update a few places to Python 3.x syntax Reviewers: zturner, lldb-commits Reviewed By: zturner Subscribers: stella.stamenova, labath, llvm-commits Differential Revision: https://reviews.llvm.org/D42994 llvm-svn: 324671
* Build each testcase variant in its own subdirectory and remove the srcdir ↵Adrian Prantl2018-02-061-63/+42
| | | | | | | | | | | | | | 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
* [dotest] make debug info variant accessible in setUp()Pavel Labath2018-02-051-18/+19
| | | | | | | | | | | | | | | | | | | | | | | Summary: This changes the way we store the debug info variant to make it available earlier in the test bringup: instead of it being set by the test wrapper method, it is set as a *property* of the wrapper method. This way, we can inspect it as soon as self.testMethodName is initialized. The retrieval is implemented by a new function TestBase.getDebugInfo(), and all that's necessary to make it work is to change self.debug_info into self.getDebugInfo(). While searching for debug_info occurences i noticed that TestLogging is being replicated for no good reason, so I removed the replication there. Reviewers: aprantl, jingham Subscribers: eraman, JDevlieghere, lldb-commits Differential Revision: https://reviews.llvm.org/D42836 llvm-svn: 324226
* Enforce that NO_DEBUG_INFO_TESTCASEs build using buildDefault().Adrian Prantl2018-01-301-0/+12
| | | | | | This is a prerequisite for building each test variant in its own subdirectory. llvm-svn: 323830
* Compile the LLDB tests out-of-tree.Adrian Prantl2018-01-301-49/+72
| | | | | | | | | | | | | | | | | | | | | | | | 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
* Enforce that tests building with buildDefault set NO_DEBUG_INFO_TESTCASEAdrian Prantl2018-01-301-0/+2
| | | | | | | and fix resulting errors. This is a prerequisite for building each test variant in its own build directory. llvm-svn: 323789
* One more TestGDBRemoteClient/windows fixPavel Labath2018-01-301-2/+3
| | | | | | We also need to be .EXE-aware when searching for the clang binary. llvm-svn: 323763
* Fix TestGDBRemoteClient on windowsPavel Labath2018-01-301-2/+3
| | | | | | | | | The logic was incorrect because on windows, we need to look for yaml2obj.EXE. I implement the search in terms of distutils.spawn.find_executable, which should handle the platform differences for us. llvm-svn: 323744
* dotest: Apply --skip-categories to debug info categoriesVedant Kumar2018-01-301-1/+1
| | | | llvm-svn: 323723
* [lldb] Generic base for testing gdb-remote behaviorPavel Labath2018-01-291-4/+29
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: Adds new utilities that make it easier to write test cases for lldb acting as a client over a gdb-remote connection. - A GDBRemoteTestBase class that starts a mock GDB server and provides an easy way to check client packets - A MockGDBServer that, via MockGDBServerResponder, can be made to issue server responses that test client behavior. - Utility functions for handling common data encoding/decoding - Utility functions for creating dummy targets from YAML files ---- Split from the review at https://reviews.llvm.org/D42145, which was a new feature that necessitated the new testing capabilities. Reviewers: clayborg, labath Reviewed By: clayborg, labath Subscribers: hintonda, davide, jingham, krytarowski, mgorny, lldb-commits Differential Revision: https://reviews.llvm.org/D42195 Patch by Owen Shaw <llvm@owenpshaw.net> llvm-svn: 323636
* Move getBuildArtifact() from TestBase to Base and derive MiTestCaseBase from itAdrian Prantl2018-01-231-4/+4
| | | | | | Thanks to Pavel Labath for pointing this out! llvm-svn: 323219
* Wrap all references to build artifacts in the LLDB testsuite (NFC)Adrian Prantl2018-01-191-1/+6
| | | | | | | | | 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
* Remove getCategories mechanism of specifying test categoriesPavel Labath2017-11-021-24/+0
| | | | | | | | | | | | | | | | | | Summary: This mechanism was mostly redundant with the file-based .categories mechanism, and it was interfering with it, as any test which implemented a getCategories method would not inherit the filesystem categories. This patch removes it. The existing categories are preserved either by adding a .categories file, or using the @add_test_categories decorator. Reviewers: jingham, clayborg, zturner Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D39515 llvm-svn: 317277
OpenPOWER on IntegriCloud