summaryrefslogtreecommitdiff
path: root/lldb/test/API/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjCNSDate.py
AgeCommit message (Collapse)Author
2024-01-21[lldb] Skip ObjC timezone tests on macOS >= 14 (NFC) (#78817)Dave Lee
Starting with macOS 14, the `NSTimeZone` and `CFTimeZone` types are backed by swift implementations. These tests won't pass on mainline lldb, since it doesn't have Swift support.
2023-10-20[lldb][test] Turn ObjC string literals to C-style literals (NFC) (#69793)Dave Lee
The underlying timezone classes are being reimplemented in Swift, and these strings will be Swift strings, without the ObjC `@` prefix. Leaving off the `@` makes these tests usable both before and after the reimplmentation of Foundation in Swift.
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
2021-08-06Re-land "[lldb] Upstream support for Foundation constant classes"Jonas Devlieghere
Upstream support for NSConstantArray, NSConstantIntegerNumber, NSConstant{Float,Double}Number and NSConstantDictionary. We would've upstreamed this earlier but testing it requires -fno-constant-nsnumber-literals, -fno-constant-nsarray-literals and -fno-constant-nsdictionary-literals which haven't been upstreamed yet. As a temporary workaround use the system compiler (xcrun clang) for the constant variant of the tests. I'm just upstreaming this. The patch and the tests were all authored by Fred Riss. Differential revision: https://reviews.llvm.org/D107660
2021-08-06Revert "[lldb] Upstream support for Foundation constant classes"Sterling Augustine
This reverts commit 34d78b6a6755946e547afc47d38b59b6a2854457. This breaks build bots witha missing file: /home/worker/2.0.1/lldb-x86_64-debian/llvm-project/lldb/source/Plugins/Language/ObjC/Cocoa.cpp:10:10: fatal error: 'objc/runtime.h' file not found
2021-08-06[lldb] Upstream support for Foundation constant classesJonas Devlieghere
Upstream support for NSConstantArray, NSConstantIntegerNumber, NSConstant{Float,Double}Number and NSConstantDictionary. We would've upstreamed this earlier but testing it requires -fno-constant-nsnumber-literals, -fno-constant-nsarray-literals and -fno-constant-nsdictionary-literals which haven't been upstreamed yet. As a temporary workaround use the system compiler (xcrun clang) for the constant variant of the tests. I'm just upstreaming this. The patch and the tests were all authored by Fred Riss. Differential revision: https://reviews.llvm.org/D107660
2020-11-10[lldb] [test] Skip ObjC-based tests via 'objc' categoryMichał Górny
Replace the plethora of ObjC-implied 'skipUnlessDarwin' decorators with marking tests as 'objc' category (whenever missing), and skip all ObjC tests on non-Darwin platforms. I have used '.categories' file wherever it was present already or all (>1) tests were relying on ObjC, and explicit add_test_categories() where there was only one test. Differential Revision: https://reviews.llvm.org/D91056
2020-07-15[lldb][formatters] Add support for printing NSConstantDate and fix ↵Raphael Isemann
distantPast value Summary: Certain `NSDate` constructors return a special `NSConstantDate` class which currently ends up being unformatted as it's not in the list of supported classes for the NSDate formatter. This patch adds that class to the supported class list so LLDB produces a summary for it. One of these special constructors is `[NSDate distantPast]` which returns the date for `0001-01-01 00:00:00 UTC`. LLDB has a special case for formatting this date but for some reason we did hardcode the wrong summary string in that special case. Maybe the summary string was correct back when the code was written but it isn't correct anymore (`distantPast` isn't actually defined to be a special date but just some 'a guaranteed temporal boundary.' so maybe someone changed the value in the last 10 years). If someone else is wondering why we even have this special case for `distantPast` but not for the future. The reason seems to be that our date formatting for really old dates is off by 24 hours. So for example, adding one second to `distantPast` will cause LLDB to print `0000-12-30 00:00:01 UTC` (which is 24 hours behind the expected result). So to make our code appear to be correct it seems we just hardcoded the most common NSDate result from that time span. I'll replace that logic with a generic solution in a probably more invasive follow up patch. I also took the freedom to replace the magic value `-63114076800` with some constant + documentation. I heard there are some people that don't know from the top of their head that there are 63114076800 seconds between 1. Jan 0001 and 1. January 2001 in whatever calendar system NSDate is using. Reviewers: mib, davide Reviewed By: mib Subscribers: JDevlieghere Differential Revision: https://reviews.llvm.org/D83217
2020-07-06[lldb] Always round down in NSDate's formatter to match NSDate's builtin formatRaphael Isemann
Summary: When printing an NSDate (for example with `NSLog` or `po`) the seconds value is always rounded down. LLDB's own formatter however isn't following that behaviour which leads to situations where the formatted result is sometimes one second off. For example: ``` (lldb) p [NSDate dateWithTimeIntervalSince1970:0.1] (__NSTaggedDate *) $1 = [...] 1970-01-01 00:00:01 UTC (lldb) po [NSDate dateWithTimeIntervalSince1970:0.1] 1970-01-01 00:00:00 +0000 (lldb) p [NSDate dateWithTimeIntervalSince1970:0.6] (__NSTaggedDate *) $4 =[...] 1970-01-01 00:00:01 UTC (lldb) po [NSDate dateWithTimeIntervalSince1970:0.6] 1970-01-01 00:00:00 +0000 ``` This patch just always rounds down the seconds value we get from the NSDate object. Fixes rdar://65084800 Reviewers: mib, davide Reviewed By: mib Subscribers: JDevlieghere Differential Revision: https://reviews.llvm.org/D83221
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