aboutsummaryrefslogtreecommitdiff
path: root/lldb/packages/Python/lldbsuite/test/dotest.py
AgeCommit message (Collapse)AuthorFilesLines
2025-09-04[lldb] Add utility to create Mach-O corefile from YAML desc (#153911)Jason Molenda1-0/+3
I've wanted a utility to create a corefile for test purposes given a bit of memory and regsters, for a while. I've written a few API tests over the years that needed exactly this capability -- we have several one-off Mach-O corefile creator utility in the API testsuite to do this. But it's a lot of boilerplate when you only want to specify some register contents and memory contents, to create an API test. This adds yaml2mach-core, a tool that should build on any system, takes a yaml description of register values for one or more threads, optionally memory values for one or more memory regions, and can take a list of UUIDs that will be added as LC_NOTE "load binary" metadata to the corefile so binaries can be loaded into virtual address space in a test scenario. The format of the yaml file looks like ``` cpu: armv7m # optionally specify the number of bits used for addressing # (this line is from a different, 64-bit, yaml file) addressable-bits: num-bits: 39 # optionally specify one or more binary UUID and slide/virtual address to be added as an LC_NOTE # (this line is from a different, 64-bit, yaml file) binaries: - name: debug-binary.development uuid: 67942352-5857-3D3D-90CB-A3F80BA67B04 virtual-address: 0xfffffff01840c000 threads: - regsets: - flavor: gpr registers: [{name: sp, value: 0x2000fe70}, {name: r7, value: 0x2000fe80}, {name: pc, value: 0x0020392c}, {name: lr, value: 0x0020392d}] memory-regions: # stack memory - addr: 0x2000fe70 UInt32: [ 0x0000002a, 0x20010e58, 0x00203923, 0x00000001, 0x2000fe88, 0x00203911, 0x2000ffdc, 0xfffffff9 ] # instructions of a function - addr: 0x203910 UInt8: [ 0xf8, 0xb5, 0x04, 0xaf, 0x06, 0x4c, 0x07, 0x49, 0x74, 0xf0, 0x2e, 0xf8, 0x01, 0xac, 0x74, 0xf0 ] ``` and that's all that is needed to specify a corefile where four register values are specified (the others will be set to 0), and two memory regions will be emitted. The memory can be specified as an array of UInt8, UInt32, or UInt64, I anticipate that some of these corefiles may have stack values constructed manually and it may be simpler for a human to write them in a particular grouping of values. I needed this utility for an upcoming patch for ARM Cortex-M processors, to create a test for the change. I took the opportunity to remove two of the "trivial mach-o corefile" creator utilities I've written in the past, which also restricted the tests to only run on Darwin systems because I was using the system headers for Mach-O constant values. rdar://110663219
2025-07-31[lldb] Don't use NamedTemporaryFile to test compiler support (#151387)Jonas Devlieghere1-4/+5
You cannot use a NamedTempFile with an external process because it may not be flushed to disk. The safest and most portable approach is to close the file, call the other process and then unlink the file manually. Presumably this works fine on Linux, but it fails on Darwin when targeting remote-linux. See https://bugs.python.org/issue29573
2025-07-31[lldb] Support Darwin cross compilation for remote Linux test suite runs ↵Jonas Devlieghere1-0/+5
(#151403) Fix cross-compilation of test inferiors on Darwin, targeting remote Linux. This requires specifying the target triple and using LLD for linking. Fixes #150806
2025-07-29[lldb] Fix libcxx configuration in dotest.py (#151258)Jonas Devlieghere1-3/+5
We emit a warning when running the test suite remotely that says the libcxx arguments will be ignored, but because they're set outside the conditional block, we're not actually do this. Fix the logic by moving the configuration in the conditional else-block.
2025-07-08[LLDB] Add type summaries for MSVC STL strings (#143177)nerix1-0/+41
This PR adds type summaries for `std::{string,wstring,u8string,u16string,u32string}` from the MSVC STL. See https://github.com/llvm/llvm-project/issues/24834 for the MSVC STL issue. The following changes were made: - `dotest.py` now detects if the MSVC STL is available. It does so by looking at the target triple, which is an additional argument passed from Lit. It specifically checks for `windows-msvc` to not match on `windows-gnu` (i.e. MinGW/Cygwin). - (The main part): Added support for summarizing `std::(w)string` from MSVC's STL. Because the type names from the libstdc++ (pre C++ 11) string types are the same as on MSVC's STL, `CXXCompositeSummaryFormat` is used with two entries, one for MSVC's STL and one for libstdc++. With MSVC's STL, `std::u{8,16,32}string` is also handled. These aren't handled for libstdc++, so I put them in `LoadMsvcStlFormatters`.
2025-05-23[lldb] Adding a new decorator for CMAKE_BUILD_TYPE. (#141159)John Harrison1-0/+1
In lldb-dap, we have existing tests that are known to be unstable when lldb and lldb-dap are built in the Debug configuration. This decorator lets us skip those tests in CI jobs that are to slow with those configurations. This was split out from #140777 to make the patches smaller.
2025-04-01[lldb] add --platform-available-ports option to the dotest.py (#112555)dlav-sc1-0/+2
This patch adds --platform-available-ports option to the dotest.py script to avoid hardcoded gdb ports in lldb testsuite. Currently, this option could be helpful in GdbRemoteTestCases (e.g. TestLldbGdbServer, TestNonStop, TestGdbRemoteThreadsInStopReply, TestGdbRemotePlatformFile, TestGdbRemote_vCont)
2024-10-10[lldb] Add early CMake check for 'make' tool (#111531)Stefan Gränitz1-4/+0
Many LLDB's dotest.py based tests require the `make` tool. If it's not found in Path, they fail with an obscure error and show up as `UNRESOLVED`. On Windows, llvm-lit takes care of MSYS based testing tools like cat, printf, etc., but `make` is not part of that. Let's catch the situation early and check for it at configuration time. This error isn't fatal: It should fail the build, but not immediately stop the configuration process. There might be other issues further down the line that can be caught in the same buildbot run.
2024-09-25[lldb][test] Use tools from llvm instead of compiler tools (#109961)Vladislav Dzhidzhoev1-0/+1
In #102185, toolchain detection for API tests has been rewritten in Python. Tools paths for tests there are determined from compiler path. Here tools are taken from `--llvm-tools-dir` dotest.py argument, which by default refers to the LLVM build directory, unless they are explicitly redefined in environment variables. It helps to minimize external dependencies and to maximize the reproducibility of the build.
2024-06-26[lldb] fix(lldb/**.py): fix comparison to None (#94017)Eisuke Kawashima1-1/+1
from PEP8 (https://peps.python.org/pep-0008/#programming-recommendations): > Comparisons to singletons like None should always be done with is or is not, never the equality operators. Co-authored-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
2024-06-03[lldb][test] Add --make argument to dotest.py (#93883)Vladislav Dzhidzhoev1-0/+7
This argument allows to specify the path to make which is used by LLDB API tests to compile test programs. It might come in handy for setting up cross-platform remote runs of API tests on Windows host. It can be used to override the make path of LLDB API tests using `LLDB_TEST_USER_ARGS` argument: ``` cmake ... -DLLDB_TEST_USER_ARGS="...;--make;C:\\Path\\to\\make.exe;..." ... ```
2024-05-31[lldb][test] Add --sysroot argument to dotest.pyVladislav Dzhidzhoev1-1/+3
This argument allows to set specific sysroot pass which will be used for building LLDB API test programs. It might come in handy for setting up cross-platform remote runs of API tests on Windows host. It can be useful for cross-compiling LLDB API tests. The argument can be set using `LLDB_TEST_USER_ARGS` argument: ``` cmake ... -DLLDB_TEST_USER_ARGS="...;--sysroot;C:\path\to\sysroot;..." ... ```
2024-05-24[lldb-dap] Automatically skip lldb-dap tests for remote platforms (#93169)Pavel Labath1-6/+19
The don't currently work (and they're also not particularly useful, since all of the remote stuff happens inside lldb). This saves us from annotating tests one by one.
2024-04-29Add a new SBExpressionOptions::SetLanguage() API (NFCI) (#89981)Adrian Prantl1-0/+3
that separates out language and version. To avoid reinventing the wheel and introducing subtle incompatibilities, this API uses the table of languages and versiond defined by the upcoming DWARF 6 standard (https://dwarfstd.org/languages-v6.html). While the DWARF 6 spec is not finialized, the list of languages is broadly considered stable. The primary motivation for this is to allow the Swift language plugin to switch between language dialects between, e.g., Swift 5.9 and 6.0 with out introducing a ton of new language codes. On the main branch this change is considered NFC. Depends on https://github.com/llvm/llvm-project/pull/89980
2024-04-17[lldb][test] Improve invalid compiler error messageDavid Spickett1-1/+1
I was debugging space separation issues when passing user arguments and noticed this error is really hard to read in that scenario. Put "" around the invalid compiler name so you can tell whether you have spaces around it that's causing the problem.
2024-03-13[lldb][test] Add `pexpect` category for tests that `import pexpect` (#84860)Jordan Rupprecht1-0/+13
Instead of directly annotating pexpect-based tests with `@skipIfWindows`, we can tag them with a new `pexpect` category. We still automatically skip windows behavior by adding `pexpect` to the skip category list if the platform is windows, but also allow non-Windows users to skip them by configuring cmake with `-DLLDB_TEST_USER_ARGS=--skip-category=pexpect` As a prerequisite, remove the restriction that `@add_test_categories` can only apply to test cases, and we make the test runner look for categories on both the class and the test method.
2024-02-13[lldb][test] Switch LLDB API tests from vendored unittest2 to unittest (#79945)Jordan Rupprecht1-8/+6
This removes the dependency LLDB API tests have on lldb/third_party/Python/module/unittest2, and instead uses the standard one provided by Python. This does not actually remove the vendored dep yet, nor update the docs. I'll do both those once this sticks. Non-trivial changes to call out: - expected failures (i.e. "bugnumber") don't have a reason anymore, so those params were removed - `assertItemsEqual` is now called `assertCountEqual` - When a test is marked xfail, our copy of unittest2 considers failures during teardown to be OK, but modern unittest does not. See TestThreadLocal.py. (Very likely could be a real bug/leak). - Our copy of unittest2 was patched to print all test results, even ones that don't happen, e.g. `(5 passes, 0 failures, 1 errors, 0 skipped, ...)`, but standard unittest prints a terser message that omits test result types that didn't happen, e.g. `OK (skipped=1)`. Our lit integration parses this stderr and needs to be updated w/ that expectation. I tested this w/ `ninja check-lldb-api` on Linux. There's a good chance non-Linux tests have similar quirks, but I'm not able to uncover those.
2024-01-26[lldb] Remove obsolete signBinary helper (#79656)Jonas Devlieghere1-2/+0
On Darwin, the Makefile already (ad-hoc) signs everything it builds. There's also no need to use lldb_codesign for this.
2023-10-19[lldb] Rename lldb-vscode to lldb-dap (#69264)Jonas Devlieghere1-10/+10
Rename lldb-vscode to lldb-dap. This change is largely mechanical. The following substitutions cover the majority of the changes in this commit: s/VSCODE/DAP/ s/VSCode/DAP/ s/vscode/dap/ s/g_vsc/g_dap/ Discourse RFC: https://discourse.llvm.org/t/rfc-rename-lldb-vscode-to-lldb-dap/74075/
2023-08-14[lldb] Remove use of __future__ in pythonAlex Langford1-3/+0
These were useful primarily for the Python 2 to 3 transition. Python 2 is no longer supported so these are no longer necessary. Differential Revision: https://reviews.llvm.org/D157759
2023-05-25[NFC][Py Reformat] Reformat python files in lldbJonas Devlieghere1-154/+225
This is an ongoing series of commits that are reformatting our Python code. Reformatting is done with `black` (23.1.0). If you end up having problems merging this commit because you have made changes to a python file, the best way to handle that is to run `git checkout --ours <yourfile>` and then reformat it with black. RFC: https://discourse.llvm.org/t/rfc-document-and-standardize-python-code-style Differential revision: https://reviews.llvm.org/D151460
2022-11-29[lldb/test] Use SBPlatform info for lldbplatformutil.getPlatform()Pavel Labath1-11/+11
Previously, we just used the platform name. This worked mostly OK, but it required adding special handling for any unusual (and potentially downstream) platform plugins, as evidenced by the hardcoding of the qemu-user platform. The current implementation was added in D121605/21c5bb0a636c23ec75b13681c0a6fdb03ecd9c0d, which this essentially reverts and goes back to the previous method of retrieving the platform name from the platform triple (the "OS" field). The motivation for D121605 was the ability to retrieve the process without constructing an SBDebugger object (which would be necessary in a world where SBPlatforms are managed by SBDebuggers). However, this world did not arrive (mainly due to other commitments on my part), and I now think that if we do want to go in that direction, that we should just create a dummy/empty SBDebugger object for holding the initial SBPlatform. One benefit of D121605 was the unification of getPlatform and getHostPlatform code paths, and I preserve that benefit by unifying them in the other direction -- using the host SBPlatform for getHostPlatform. Differential Revision: https://reviews.llvm.org/D138430
2022-10-26[test] Fix LLDB tests with just-built libcxx when using a target directory.Jordan Rupprecht1-6/+4
In certain configurations, libc++ headers all exist in the same directory, and libc++ binaries exist in the same directory as lldb libs. When `LLVM_ENABLE_PER_TARGET_RUNTIME_DIR` is enabled (*and* the host is not Apple, which is why I assume this wasn't caught by others?), this is not the case: most headers will exist in the usual `include/c++/v1` directory, but `__config_site` exists in `include/$TRIPLE/c++/v1`. Likewise, the libc++.so binary exists in `lib/$TRIPLE/`, not `lib/` (where LLDB libraries reside). This also adds the just-built-libcxx functionality to the lldb-dotest tool. The `LIBCXX_` cmake config is borrowed from `libcxx/CMakeLists.txt`. I could not figure out a way to share the cmake config; ideally we would reuse the same config instead of copy/paste. Reviewed By: JDevlieghere, fdeazeve Differential Revision: https://reviews.llvm.org/D133973
2022-09-15[lldb] Improve formatting of skipped categories message (NFC)Dave Lee1-1/+2
2022-08-19[lldb] Support specifying a custom libcxx for the API testsJonas Devlieghere1-4/+11
This patch combines D129166 (to always pick the just-built libc++) and D132257 (to allow customizing the libc++ for testing). The common goal is to avoid picking up an unexpected libc++ for testing. Differential revision: https://reviews.llvm.org/D132263
2022-08-11[lldb] Remove uses of six module (NFC)Dave Lee1-1/+0
With lldb (& llvm) requiring Python 3.6+, use of the `six` module can be removed. Differential Revision: https://reviews.llvm.org/D131304
2022-07-11[lldb] Use the just-built libc++ for testing the LLDB data formattersJonas Devlieghere1-0/+5
Make sure we use the libc++ from the build dir. Currently, by passing -stdlib=libc++, we might pick up the system libc++. This change ensures that if LLVM_LIBS_DIR is set, we try to use the libc++ from there. Differential revision: https://reviews.llvm.org/D129166
2022-04-13[lldb] Remove the global platform listPavel Labath1-1/+1
This patch moves the platform creation and selection logic into the per-debugger platform lists. I've tried to keep functional changes to a minimum -- the main (only) observable difference in this change is that APIs, which select a platform by name (e.g., Debugger::SetCurrentPlatform) will not automatically pick up a platform associated with another debugger (or no debugger at all). I've also added several tests for this functionality -- one of the pleasant consequences of the debugger isolation is that it is now possible to test the platform selection and creation logic. This is a product of the discussion at <https://discourse.llvm.org/t/multiple-platforms-with-the-same-name/59594>. Differential Revision: https://reviews.llvm.org/D120810
2022-04-07[lldb] Add Python bindings to print stack traces on crashes.Jonas Devlieghere1-0/+1
As noticed in D87637, when LLDB crashes, we only print stack traces if LLDB is directly executed, not when used via Python bindings. Enabling this by default may be undesirable (libraries shouldn't be messing with signal handlers), so make this an explicit opt-in. I "commandeered" this patch from Jordan Rupprecht who put this up for review originally. Differential revision: https://reviews.llvm.org/D91835
2022-03-30Recommit [lldb/test] Make category-skipping logic "platform"-independentPavel Labath1-12/+13
This recommits dddf4ce03, which was reverted because of a couple of test failures on macos. The reason behind the failures was that the patch inadvertenly changed the value returned by the host platform from "macosx" to "darwin". The new version fixes that. Original commit message was: The decision which categories are relevant for a particular test run happen very early in the test setup process. They use the SBPlatform object to determine which categories should be skipped. The platform object created for this purpose transcends individual test runs. This setup is not compatible with the direction discussed in <https://discourse.llvm.org/t/multiple-platforms-with-the-same-name/59594> -- when platform objects are tied to a specific (SB)Debugger, they need to be created alongside it, which currently happens in the test setUp method. This patch is the first step in that direction -- it rewrites the category skipping logic to avoid depending on a global SBPlatform object. Fortunately, the skipping logic is fairly simple (and I believe it outght to stay that way) and mainly consists of comparing the platform name against some hardcoded lists. This patch bases this comparison on the platform name instead of the os part of the triple (as reported by the platform). Differential Revision: https://reviews.llvm.org/D121605
2022-03-15Revert "[lldb/test] Make category-skipping logic "platform"-independent"Pavel Labath1-14/+12
This reverts commit dddf4ce034a8e06cc1351492dceece3fa2344c14. It breaks a couple of tests on macos.
2022-03-15[lldb/test] Make category-skipping logic "platform"-independentPavel Labath1-12/+14
The decision which categories are relevant for a particular test run happen very early in the test setup process. They use the SBPlatform object to determine which categories should be skipped. The platform object created for this purpose transcends individual test runs. This setup is not compatible with the direction discussed in <https://discourse.llvm.org/t/multiple-platforms-with-the-same-name/59594> -- when platform objects are tied to a specific (SB)Debugger, they need to be created alongside it, which currently happens in the test setUp method. This patch is the first step in that direction -- it rewrites the category skipping logic to avoid depending on a global SBPlatform object. Fortunately, the skipping logic is fairly simple (and I believe it outght to stay that way) and mainly consists of comparing the platform name against some hardcoded lists. This patch bases this comparison on the platform name instead of the os part of the triple (as reported by the platform). Differential Revision: https://reviews.llvm.org/D121605
2022-01-25[lldb/test] Use abspath when searching for lldb.exePavel Labath1-1/+1
realpath is too aggressive and does not produce the desired effect if ones build folder is a symlink farm.
2021-09-30[lldb] Remove support for replaying the test suite from a reproducerJonas Devlieghere1-22/+1
This patch removes the infrastructure to replay the test suite from a reproducer, as well as the modifications made to the individual tests.
2021-06-28[LLDB] dotest.py set selected_platform on remote connectionMuhammad Omair Javaid1-3/+1
This patch fixes a bug in dotest.py where lldb.selected_platform was being set to host platform even after a successful connection to a remote platform via platform url. This patch fixes this behavior and sets selected_platform to remote_platform after a successful connection. This patch also removes target_platform variable from run_suite. Reviewed By: JDevlieghere Differential Revision: https://reviews.llvm.org/D105060
2021-06-17[trace][intel-pt] Create basic SB APIWalter Erquinigo1-1/+5
This adds a basic SB API for creating and stopping traces. Note: This doesn't add any APIs for inspecting individual instructions. That'd be a more complicated change and it might be better to enhande the dump functionality to output the data in binary format. I'll leave that for a later diff. This also enhances the existing tests so that they test the same flow using both the command interface and the SB API. I also did some cleanup of legacy code. Differential Revision: https://reviews.llvm.org/D103500
2021-05-17[lldb] Let dotest check for the `cassert` header instead of `algorithm` for ↵Raphael Isemann1-1/+1
libc++ check This is just a dotest check to see if we can compile a simple program that uses libc++. Right now we are parsing the rather big `algorithm` header in the test program, but the test really just checks whether we can find *any* libc++ headers and link against some libc++ SO. Using the much smaller `cassert` header for checking whether we can find libc++ headers speeds up this check by a bit. After some incredibly unscientific performance testing this saves a few seconds when running the test suite on Linux (on macOS we hardcoded that libc++ is always there, so this check won't be used there and we don't save any time). Reviewed By: jankratochvil Differential Revision: https://reviews.llvm.org/D101056
2021-04-25[lldb] [Process/NetBSD] Report fork/vfork events to LLGSMichał Górny1-1/+1
Differential Revision: https://reviews.llvm.org/D100554
2021-04-25[lldb] [Process/FreeBSD] Report fork/vfork events to LLGSMichał Górny1-1/+1
Differential Revision: https://reviews.llvm.org/D100547
2021-04-24[lldb] [Process/Linux] Report fork/vfork stop reasonMichał Górny1-1/+1
Enable reporting fork/vfork events to the server when supported. At this moment, this is used only to test the server code, as real client does not report fork-events and vfork-events as supported. Differential Revision: https://reviews.llvm.org/D100208
2021-04-24[lldb] [Process] Introduce protocol extension support APIMichał Górny1-0/+10
Introduce a NativeProcessProtocol API for indicating support for protocol extensions and enabling them. LLGS calls GetSupportedExtensions() method on the process factory to determine which extensions are supported by the plugin. If the future is both supported by the plugin and reported as supported by the client, LLGS enables it and reports to the client as supported by the server. The extension is enabled on the process instance by calling SetEnabledExtensions() method. This is done after qSupported exchange (if the debugger is attached to any process), as well as after launching or attaching to a new inferior. The patch adds 'fork' extension corresponding to 'fork-events+' qSupported feature and 'vfork' extension for 'vfork-events+'. Both features rely on 'multiprocess+' being supported as well. Differential Revision: https://reviews.llvm.org/D100153
2021-04-14[lldb] Simplify output for skipped categories in dotest.pyJonas Devlieghere1-10/+14
Print a single line listing all the categories that are being skipped, rather than relying on the check.*Support() functions specifying why a particular category will be skipped. If we know why a category got skipped, still print that in verbose mode. The motivation for this change is that sometimes engineers misidentify the output of these messages as the cause for a test failure (e.g. not being able to build libc++ or libstdc++). Differential revision: https://reviews.llvm.org/D100508
2021-03-10[lldb] [Process/FreeBSD] Introduce aarch64 hw break/watchpoint supportMichał Górny1-0/+4
Split out the common base of Linux hardware breakpoint/watchpoint support for AArch64 into a Utility class, and use it to implement the matching support on FreeBSD. Differential Revision: https://reviews.llvm.org/D96548
2021-02-21Reapply "[lldb/test] Automatically find debug servers to test"Pavel Labath1-6/+0
This reapplies 7df4eaaa93/D96202, which was reverted due to issues on windows. These were caused by problems in the computation of the liblldb directory, which was fixed by D96779. The original commit message was: Our test configuration logic assumes that the tests can be run either with debugserver or with lldb-server. This is not entirely correct, since lldb server has two "personalities" (platform server and debug server) and debugserver is only a replacement for the latter. A consequence of this is that it's not possible to test the platform behavior of lldb-server on macos, as it is not possible to get a hold of the lldb-server binary. One solution to that would be to duplicate the server configuration logic to be able to specify both executables. However, that seems excessively redundant. A well-behaved lldb should be able to find the debug server on its own, and testing lldb with a different (lldb-|debug)server does not seem very useful (even in the out-of-tree debugserver setup, we copy the server into the build tree to make it appear "real"). Therefore, this patch deletes the configuration altogether and changes the low-level server retrieval functions to be able to both lldb-server and debugserver paths. They do this by consulting the "support executable" directory of the lldb under test. Differential Revision: https://reviews.llvm.org/D96202
2021-02-11Revert "[lldb/test] Automatically find debug servers to test"Pavel Labath1-0/+6
The commit 7df4eaaa937332c0617aa665080533966e2c98a0 appears to break the windows bot. Revert while I investigate.
2021-02-11[lldb/test] Automatically find debug servers to testPavel Labath1-6/+0
Our test configuration logic assumes that the tests can be run either with debugserver or with lldb-server. This is not entirely correct, since lldb server has two "personalities" (platform server and debug server) and debugserver is only a replacement for the latter. A consequence of this is that it's not possible to test the platform behavior of lldb-server on macos, as it is not possible to get a hold of the lldb-server binary. One solution to that would be to duplicate the server configuration logic to be able to specify both executables. However, that seems excessively redundant. A well-behaved lldb should be able to find the debug server on its own, and testing lldb with a different (lldb-|debug)server does not seem very useful (even in the out-of-tree debugserver setup, we copy the server into the build tree to make it appear "real"). Therefore, this patch deletes the configuration altogether and changes the low-level server retrieval functions to be able to both lldb-server and debugserver paths. They do this by consulting the "support executable" directory of the lldb under test. Differential Revision: https://reviews.llvm.org/D96202
2021-02-05[lldb/test] Reduce API test tools configuration boilerplatePavel Labath1-12/+5
Replace the dotest command line options and various cmake variables, which are used for passing the locations of llvm tools to the API tests with a single variable, which points to the directory these tools are placed in. Besides reducing repetition, this also makes things more similar to how "normal" llvm tests are configured. Differential Revision: https://reviews.llvm.org/D95261
2021-01-24[lldb] Add -Wl,-rpath to make tests run with fresh built libc++Fangrui Song1-2/+0
On my Debian machine, system libc++/libc++abi is not installed (`libc++1-9 libc++abi-9`), 21 check-lldb-api tests fail because -stdlib=libc++ linked executables cannot find runtime libc++.so.1 at runtime. Use the `-Wl,-rpath,$(LLVM_LIBS_DIR)` mechanism in `packages/Python/lldbsuite/test/make/Makefile.rules` (D58630 for NetBSD) to allow such tests compile/link with fresh libc++ built beside lldb. (A system libc++.so.1 is not guaranteed to match fresh libc++ header files.) Some tweaks to the existing NetBSD rule when generalizing: * Drop `-L$(LLVM_LIBS_DIR)` since Clang driver adds it correctly. * Add `-stdlib=libc++` only for `USE_LIBCPP`. Also, drop `-isystem /usr/include/c++/v1` introduced in D9426. It is not needed by Clang driver. GCC using libc++ requires more setup. I don't find any test needing `-Wl,-rpath` in `test/Shell/helper/{build,toolchain}.py` (D58630 for NetBSD added them). Reviewed By: labath Differential Revision: https://reviews.llvm.org/D94888
2020-12-27[lldb/test] Automatically skip remote lldb-server tests when applicablePavel Labath1-0/+9
The tests don't work with remote debugservers. This isn't a problem with any particular test, but the test infrastructure itself, which is why each of these tests has a @skipIfDarwinEmbedded decorator. This patch replaces that with a central category-based solution. It also moves the ad-hoc windows skipping mechanism there too.
2020-12-10[lldb/test] Replace ad-hoc server test choice with test categoriesPavel Labath1-7/+9
This makes things consistent, and enables further simplifications down the road.