summaryrefslogtreecommitdiff
path: root/lldb/test/API/python_api/value/change_values
AgeCommit message (Collapse)Author
2024-11-12[lldb] Support true/false in ValueObject::SetValueFromCString (#115780)Jonas Devlieghere
Support "true" and "false" (and "YES" and "NO" in Objective-C) in ValueObject::SetValueFromCString. Fixes #112597
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`.
2024-02-16[lldb] Replace assertEquals with assertEqual (NFC) (#82073)Jonas Devlieghere
assertEquals is a deprecated alias for assertEqual and has been removed in Python 3.12. This wasn't an issue previously because we used a vendored version of the unittest module. Now that we use the built-in version this gets updated together with the Python version used to run the test suite.
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[NFC][LLDB] Rename test filePavel Kosov
Commit 92f0e4cca introduced test file with name TestChangeValue.py, which leads to test failure because there already is a test files with the same name In this commit a newly added file is renamed to fix this failure
2023-01-25[LLDB] Fixes summary formatter for libc++ map allowing modification of ↵Pavel Kosov
contained value Reviewed By: clayborg Differential Revision: https://reviews.llvm.org/D140624
2023-01-25[LLDB] Fix for libc++ atomic allowing modification of contained valuePavel Kosov
Reviewed By: clayborg Differential Revision: https://reviews.llvm.org/D140623
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-06-08[lldb] Add assertState function to the API test suiteJonas Devlieghere
Add a function to make it easier to debug a test failure caused by an unexpected state. Currently, tests are using assertEqual which results in a cryptic error message: "AssertionError: 5 != 10". Even when a test provides a message to make it clear why a particular state is expected, you still have to figure out which of the two was the expected state, and what the other value corresponds to. We have a function in lldbutil that helps you convert the state number into a user readable string. This patch adds a wrapper around assertEqual specifically for comparing states and reporting better error messages. The aforementioned error message now looks like this: "AssertionError: stopped (5) != exited (10)". If the user provided a message, that continues to get printed as well. Differential revision: https://reviews.llvm.org/D127355
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-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.
2021-02-03[lldb] Convert more assertTrue to assertEqual (NFC)Dave Lee
Follow up to D95813, this converts multiline assertTrue to assertEqual. Differential Revision: https://reviews.llvm.org/D95899
2020-05-20[lldb/Reproducers] Fix/skip passive replay failures in python_api subdirJonas Devlieghere
Fixes or skips tests in the python_api subdirectory that were failing with passive replay.
2020-02-13[lldb] Replace assertTrue(a == b, "msg") with assertEquals(a, b, "msg") in ↵Raphael Isemann
the test suite Summary: The error message from the construct `assertTrue(a == b, "msg") ` are nearly always completely useless for actually debugging the issue. This patch is just replacing this construct (and similar ones like `assertTrue(a != b, ...)` with the proper call to assertEqual or assertNotEquals. This patch was mostly written by a shell script with some manual verification afterwards: ``` lang=python import sys def sanitize_line(line): if line.strip().startswith("self.assertTrue(") and " == " in line: line = line.replace("self.assertTrue(", "self.assertEquals(") line = line.replace(" == ", ", ", 1) if line.strip().startswith("self.assertTrue(") and " != " in line: line = line.replace("self.assertTrue(", "self.assertNotEqual(") line = line.replace(" != ", ", ", 1) return line for a in sys.argv[1:]: with open(a, "r") as f: lines = f.readlines() with open(a, "w") as f: for line in lines: f.write(sanitize_line(line)) ``` Reviewers: labath, JDevlieghere Reviewed By: labath Subscribers: abidh, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D74475
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