summaryrefslogtreecommitdiff
path: root/lldb/test/API/python_api/file_handle/TestFileHandle.py
AgeCommit message (Collapse)Author
2024-02-21[lldb][test] Modernize asserts (#82503)Jordan Rupprecht
This uses [teyit](https://pypi.org/project/teyit/) to modernize asserts, as recommended by the [unittest release notes](https://docs.python.org/3.12/whatsnew/3.12.html#id3). For example, `assertTrue(a == b)` is replaced with `assertEqual(a, b)`. This produces better error messages, e.g. `error: unexpectedly found 1 and 2 to be different` instead of `error: False`.
2023-05-25[NFC][Py Reformat] Reformat python files in lldbJonas Devlieghere
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
2023-01-25[lldb][test] Replace use of p with expression (NFC)Dave Lee
In API tests, replace use of the `p` alias with the `expression` command. To avoid conflating tests of the alias with tests of the expression command, this patch canonicalizes to the use `expression`. Differential Revision: https://reviews.llvm.org/D141539
2022-06-17[lldb][tests] Automatically call compute_mydir (NFC)Dave Lee
Eliminate boilerplate of having each test manually assign to `mydir` by calling `compute_mydir` in lldbtest.py. Differential Revision: https://reviews.llvm.org/D128077
2022-04-27Remove Python 2 checks from the test suiteJonas Devlieghere
We dropped downstream support for Python 2 in the previous release. Now that we have branched for the next release the window where this kind of change could introduce conflicts is closing too. Remove Python 2 checks from the test suite. Differential revision: https://reviews.llvm.org/D124429
2022-02-14[lldb] Replace asserts on .Success() with assertSuccess()Dave Lee
Replace forms of `assertTrue(err.Success())` with `assertSuccess(err)` (added in D82759). * `assertSuccess` prints out the error's message * `assertSuccess` expresses explicit higher level semantics, both to the reader and for test failure output * `assertSuccess` seems not to be well known, using it where possible will help spread knowledge * `assertSuccess` statements are more succinct Differential Revision: https://reviews.llvm.org/D119616
2021-11-25[lldb] Fix TestFileHandle.pyPavel Labath
- remove the decorator which is no longer available in main - remove dependence on revision number, which are not available in all builds
2021-11-24Fixed use of -o and -k in LLDB under Windows when statically compiled with ↵Levon Ter-Grigoryan
vcruntime. Right now if the LLDB is compiled under the windows with static vcruntime library, the -o and -k commands will not work. The problem is that the LLDB create FILE* in lldb.exe and pass it to liblldb.dll which is an object from CRT. Since the CRT is statically linked each of these module has its own copy of the CRT with it's own global state and the LLDB should not share CRT objects between them. In this change I moved the logic of creating FILE* out of commands stream from Driver class to SBDebugger. To do this I added new method: SBError SBDebugger::SetInputStream(SBStream &stream) Command to build the LLDB: cmake -G Ninja -DLLVM_ENABLE_PROJECTS="clang;lldb;libcxx" -DLLVM_USE_CRT_RELEASE="MT" -DLLVM_USE_CRT_MINSIZEREL="MT" -DLLVM_USE_CRT_RELWITHDEBINFO="MT" -DP YTHON_HOME:FILEPATH=C:/Python38 -DCMAKE_C_COMPILER:STRING=cl.exe -DCMAKE_CXX_COMPILER:STRING=cl.exe ../llvm Command which will fail: lldb.exe -o help See discord discussion for more details: https://discord.com/channels/636084430946959380/636732809708306432/854629125398724628 This revision is for the further discussion. Reviewed By: teemperor Differential Revision: https://reviews.llvm.org/D104413
2021-09-30[lldb] Remove support for replaying the test suite from a reproducerJonas Devlieghere
This patch removes the infrastructure to replay the test suite from a reproducer, as well as the modifications made to the individual tests.
2021-02-08[lldb/tests] Removed add_test_categories decorator for python API tests, NFCTatyana Krasnukha
There is a .categories file in the python_api directory that makes all nested tests belong to the category "pyapi". The decorator is unnecessary for these tests.
2020-05-07[lldb/Test] Fix typo in find-and-replace.Jonas Devlieghere
2020-05-07[lldb/Test] Add @skipIfReproducer to tests using lldb::FileSP.Jonas Devlieghere
lldb::FileSP is a typedef for std::shared_ptr<lldb_private::File> and the reproducers cannot instrument a lldb_private constructor.
2020-03-05[lldb][test] TestFileHandle: flush the output after writeTatyana Krasnukha
2020-03-05[lldb][testsuite] Create a SBDebugger instance for each testTatyana Krasnukha
Some tests set settings and don't clean them up, this leads to side effects in other tests. The patch removes a global debugger instance with a per-test debugger to avoid such effects. From what I see, lldb.DBG was needed to determine the platform before a test is run, lldb.selected_platform is used for this purpose now. Though, this required adding a new function to the SBPlatform interface. Differential Revision: https://reviews.llvm.org/D74903
2020-02-11[lldb][test] Remove symlink for API tests.Jordan Rupprecht
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