summaryrefslogtreecommitdiffstats
path: root/lldb/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py
Commit message (Collapse)AuthorAgeFilesLines
* Move lldb/test to lldb/packages/Python/lldbsuite/test.Zachary Turner2015-10-281-464/+0
| | | | | | | | | | | This is the conclusion of an effort to get LLDB's Python code structured into a bona-fide Python package. This has a number of benefits, but most notably the ability to more easily share Python code between different but related pieces of LLDB's Python infrastructure (for example, `scripts` can now share code with `test`). llvm-svn: 251532
* Rename `lldb_shared` to `use_lldb_suite`.Zachary Turner2015-10-271-1/+1
| | | | llvm-svn: 251444
* Add from __future__ import print_function everywhere.Zachary Turner2015-10-231-0/+2
| | | | | | | | | | | | | Apparently there were tons of instances I missed last time, I guess I accidentally ran 2to3 non-recursively. This should be every occurrence of a print statement fixed to use a print function as well as from __future__ import print_function being added to every file. After this patch print statements will stop working everywhere in the test suite, and the print function should be used instead. llvm-svn: 251121
* Update every test to import `lldb_shared`.Zachary Turner2015-10-221-7/+2
| | | | | | | | | | | | | | | | | | | | | This is necessary in order to allow third party modules to be located under lldb/third_party rather than under the test folder directly. Since we're already touching every test file anyway, we also go ahead and delete the unittest2 import and main block wherever possible. The ability to run a test as a standalone file has already been broken for some time, and if we decide we want this back, we should use unittest instead of unittest2. A few places could not have the import of unittest2 removed,because they depend on the unittest2.expectedFailure or skip decorators. Removing all those was orthogonal in spirit to the purpose of this CL, so the import of unittest2 remains in those files that were using it for its test decorators. Those can be addressed separately. llvm-svn: 251055
* Add a data formatter for __NSArray0, the type of empty arraysEnrico Granata2015-10-141-0/+2
| | | | llvm-svn: 250341
* This is the work I was building up to with my patches yesterdayEnrico Granata2015-10-071-6/+6
| | | | | | | | | Introduce the notion of Language-based formatter prefix/suffix This is meant for languages that share certain data types but present them in syntatically different ways, such that LLDB can now have language-based awareness of which of the syntax variations it has to present to the user when formatting those values This is goodness for new languages and interoperability, but is NFC for existing languages. As such, existing tests cover this llvm-svn: 249587
* Route the preferred-display-language mechanism to the ValueObjectPrinter and ↵Enrico Granata2015-10-071-2/+0
| | | | | | actually fill in a few gaps for dynamic and synthetic values to be able to adopt this in useful ways llvm-svn: 249507
* Merge dwarf and dsym testsTamas Berghammer2015-09-301-127/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently most of the test files have a separate dwarf and a separate dsym test with almost identical content (only the build step is different). With adding dwo symbol file handling to the test suit it would increase this to a 3-way duplication. The purpose of this change is to eliminate this redundancy with generating 2 test case (one dwarf and one dsym) for each test function specified (dwo handling will be added at a later commit). Main design goals: * There should be no boilerplate code in each test file to support the multiple debug info in most of the tests (custom scenarios are acceptable in special cases) so adding a new test case is easier and we can't miss one of the debug info type. * In case of a test failure, the debug symbols used during the test run have to be cleanly visible from the output of dotest.py to make debugging easier both from build bot logs and from local test runs * Each test case should have a unique, fully qualified name so we can run exactly 1 test with "-f <test-case>.<test-function>" syntax * Test output should be grouped based on test files the same way as it happens now (displaying dwarf/dsym results separately isn't preferable) Proposed solution (main logic in lldbtest.py, rest of them are test cases fixed up for the new style): * Have only 1 test fuction in the test files what will run for all debug info separately and this test function should call just "self.build(...)" to build an inferior with the right debug info * When a class is created by python (the class object, not the class instance), we will generate a new test method for each debug info format in the test class with the name "<test-function>_<debug-info>" and remove the original test method. This way unittest2 see multiple test methods (1 for each debug info, pretty much as of now) and will handle the test selection and the failure reporting correctly (the debug info will be visible from the end of the test name) * Add new annotation @no_debug_info_test to disable the generation of multiple tests for each debug info format when the test don't have an inferior Differential revision: http://reviews.llvm.org/D13028 llvm-svn: 248883
* Split the portion of the data-formatter-objc test case that deals with ↵Enrico Granata2015-07-171-85/+0
| | | | | | NSString into its own separate test case llvm-svn: 242552
* Reversed r238363, because the message is inconsistentSean Callanan2015-07-011-6/+6
| | | | | | with all the other assertion messages. llvm-svn: 241212
* [TestBase.runCmd] Better error message when runCmd fails.Siva Chandra2015-05-271-6/+6
| | | | | | | | | | | | | | | | | | | | | Summary: Before: AssertionError: False is not True : Process is launched successfully After: AssertionError: False is not True : Command 'run a.out' failed. >>> error: invalid target, create a target using the 'target create' command >>> Process could not be launched successfully Reviewers: clayborg Reviewed By: clayborg Subscribers: lldb-commits, vharron Differential Revision: http://reviews.llvm.org/D9948 llvm-svn: 238363
* Replace sys.platform skips in tests with @skip decorators which check ↵Robert Flack2015-03-301-30/+30
| | | | | | | | | | | | | | | | against remote platform. Adds @skipIfPlatform and @skipUnlessPlatform decorators which will skip if / unless the target platform is in the provided platform list. Test Plan: ninja check-lldb shows no regressions. When running cross platform, tests which cannot run on the target platform are skipped. Differential Revision: http://reviews.llvm.org/D8665 llvm-svn: 233547
* Fix ObjCDataFormatterTestCase.test_nsdate_* tests (ver. 2)Ilia K2015-03-231-1/+1
| | | | | | This commit reverts r232946 because it caused an another error with absolute time. llvm-svn: 232951
* Move a bunch of summary formatters to oneliner mode. This makes more cases ↵Enrico Granata2014-11-111-10/+8
| | | | | | eligible for oneline printing, and fixes rdar://18120906 llvm-svn: 221701
* These tests all seem to pass on my machine, marking them as non-Xfail on ↵Enrico Granata2014-10-031-2/+0
| | | | | | Darwin, or clang where applicable. Non-Apple folks, if these fail for you, maybe we can put some more helpful markers on them llvm-svn: 219020
* Make this test case a little more resilient to class name changesEnrico Granata2014-10-021-1/+1
| | | | llvm-svn: 218896
* Mark failing tests in TestDataFormatterObjC on Darwin as XFAILTodd Fiala2014-07-091-0/+2
| | | | | | See http://llvm.org/bugs/show_bug.cgi?id=20260 for more details. llvm-svn: 212639
* Make sure this test has a looser dependency on the exact class generated ↵Enrico Granata2014-03-251-1/+1
| | | | | | here.. it is going to be some sort of NS-provided String, but let's not bet on the details llvm-svn: 204761
* Adapt test to avoid short string types.Jim Ingham2014-03-201-9/+9
| | | | llvm-svn: 204295
* Massive test suite cleanup to stop everyone from manually having to compute ↵Greg Clayton2013-12-101-1/+1
| | | | | | | | | | "mydir" inside each test case. This has led to many test suite failures because of copy and paste where new test cases were based off of other test cases and the "mydir" variable wasn't updated. Now you can call your superclasses "compute_mydir()" function with "__file__" as the sole argument and the relative path will be computed for you. llvm-svn: 196985
* Fix test to compile and run on iOS.Greg Clayton2013-12-031-25/+30
| | | | llvm-svn: 196313
* <rdar://problem/12042982>Enrico Granata2013-10-041-1/+1
| | | | | | | | | | | | | | | | | | | This radar extends the notion of one-liner summaries to automagically apply in a few interesting cases More specifically, this checkin changes the printout of ValueObjects to print on one-line (as if type summary add -c had been applied) iff: this ValueObject does not have a summary its children have no synthetic children its children are not a non-empty base class without a summary its children do not have a summary that asks for children to show up the aggregate length of all the names of all the children is <= 50 characters you did not ask to see the types during a printout your pointer depth is 0 This is meant to simplify the way LLDB shows data on screen for small structs and similarly compact data types (e.g. std::pair<int,int> anyone?) Feedback is especially welcome on how the feature feels and corner cases where we should apply this printout and don't (or viceversa, we are applying it when we shouldn't be) llvm-svn: 191996
* merge lldb-platform-work branch (and assorted fixes) into trunkDaniel Malea2013-08-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This merge brings in the improved 'platform' command that knows how to interface with remote machines; that is, query OS/kernel information, push and pull files, run shell commands, etc... and implementation for the new communication packets that back that interface, at least on Darwin based operating systems via the POSIXPlatform class. Linux support is coming soon. Verified the test suite runs cleanly on Linux (x86_64), build OK on Mac OS X Mountain Lion. Additional improvements (not in the source SVN branch 'lldb-platform-work'): - cmake build scripts for lldb-platform - cleanup test suite - documentation stub for qPlatform_RunCommand - use log class instead of printf() directly - reverted work-in-progress-looking changes from test/types/TestAbstract.py that work towards running the test suite remotely. - add new logging category 'platform' Reviewers: Matt Kopec, Greg Clayton Review: http://llvm-reviews.chandlerc.com/D1493 llvm-svn: 189295
* Splitting the appkit data formatters test in smaller test cases - this ↵Enrico Granata2013-04-231-55/+177
| | | | | | should enable us to get a more detailed perspective on which individual data formatters are broken llvm-svn: 180128
* Fix the .categories, it had "dataformatter" not "dataformatters".Jim Ingham2013-02-251-4/+0
| | | | | | | | Remove the getCategory from TestDataFormatterObjC.py, since it was superceded by the .categories file, and didn't work anyway (getCategories currently has to be a method on the test class, not on the test.) Add a "basic_process" category, and start to find some tests for simple process running sniff tests. llvm-svn: 176061
* <rdar://problem/12028723>Enrico Granata2013-01-091-6/+6
| | | | | | | | | | Adding useful formatting options to the expression (expr) command. As a side effect of this change, the -d option now supports the same three-values enumeration that frame variables uses (run, don't run, none) instead of a boolean like it did previously These options do not apply to print, p or po because these are aliased to not take any options. In order to use them, use expression or expr. llvm-svn: 171993
* <rdar://problem/11689939>Enrico Granata2012-12-131-1/+1
| | | | | | | | | | Supporting a compact display syntax for ObjC pointers where 0x00.....0 is replaced by a much more legible "nil" e.g. this would show: (NSArray *) $2 = nil instead of: (NSArray *) $2 = 0x0000000000000000 <nil> llvm-svn: 170161
* Option changes:Enrico Granata2012-12-121-2/+2
| | | | | | | | | | | | | | | | | the option to print the runtime-specific description has been modified in the frame variable, memory read and expression command. All three commands now support a --object-description option, with a shortcut of -O (uppercase letter o) This is a breaking change: frame variable used --objc as the long option name expression used -o as a shortcut memory read uses --objd as the long option name Hopefully, most users won't be affected by the change since people tend to access "expression --object-description" under the alias "po" which still works The test suite has been tweaked accordingly. llvm-svn: 169961
* <rdar://problem/12709976>Enrico Granata2012-12-101-0/+9
| | | | | | Adding a summary for NSError llvm-svn: 169792
* <rdar://problem/12099592> Adding back a bunch of code-running summariesEnrico Granata2012-10-031-0/+12
| | | | llvm-svn: 165186
* Fix all the test case breakages caused by folks writing tests all over the ↵Jim Ingham2012-09-221-25/+9
| | | | | | | | place that depended explicitly on the output of "break set". Please don't do this sort of thing!!!!! llvm-svn: 164433
* Initial commit of a new testsuite feature: test categories.Enrico Granata2012-09-211-0/+4
| | | | | | | | | | | | | | | | | | | | | | | This feature allows us to group test cases into logical groups (categories), and to only run a subset of test cases based on these categories. Each test-case can have a new method getCategories(self): which returns a list of strings that are the categories to which the test case belongs. If a test-case does not provide its own categories, we will look for categories in the class that contains the test case. If that fails too, the default implementation looks for a .category file, which contains a comma separated list of strings. The test suite will recurse look for .categories up until the top level directory (which we guarantee will have an empty .category file). The driver dotest.py has a new --category <foo> option, which can be repeated, and specifies which categories of tests you want to run. (example: ./dotest.py --category objc --category expression) All tests that do not belong to any specified category will be skipped. Other filtering options still exist and should not interfere with category filtering. A few tests have been categorized. Feel free to categorize others, and to suggest new categories that we could want to use. All categories need to be validly defined in dotest.py, or the test suite will refuse to run when you use them as arguments to --category. In the end, failures will be reported on a per-category basis, as well as in the usual format. This is the very first stage of this feature. Feel free to chime in with ideas for improvements! llvm-svn: 164403
* <rdar://problem/12161825> Rephrase formatter for NSIndexSet in terms of ↵Enrico Granata2012-09-181-1/+1
| | | | | | indexes instead of objects llvm-svn: 164149
* <rdar://problem/11485744> Implement important data formatters in C++. Have ↵Enrico Granata2012-09-041-2/+0
| | | | | | the Objective-C language runtime plugin expose class descriptors objects akin to the objc_runtime.py Pythonic implementation. Rewrite the data formatters for some core Cocoa classes in C++ instead of Python. llvm-svn: 163155
* <rdar://problem/11753405> Making sure we deal correctly with signed NSNumber ↵Enrico Granata2012-07-131-2/+9
| | | | | | values llvm-svn: 160179
* <rdar://problem/11755446> Making sure to provide summaries for one more ↵Enrico Granata2012-06-281-0/+3
| | | | | | NSString subclass llvm-svn: 159389
* Fixing a bug where the summary for certain NSStrings was being returned as ↵Enrico Granata2012-05-151-0/+2
| | | | | | empty in spite of the string actually having a content llvm-svn: 156793
* Automatically enabling the Cocoa formatter categories for command-line LLDB. ↵Enrico Granata2012-04-261-41/+0
| | | | | | Previously, the categories were filled in but disabled by default. Tweaking test cases appropriately to keep working and do the right thing llvm-svn: 155605
* Add a new option to the test driver, -N dsym or -N dwarf, in order to ↵Johnny Chen2012-04-061-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | exclude tests decorated with either @dsym_test or @dwarf_test to be executed during the testsuite run. There are still lots of Test*.py files which have not been decorated with the new decorator. An example: # From TestMyFirstWatchpoint.py -> class HelloWatchpointTestCase(TestBase): mydir = os.path.join("functionalities", "watchpoint", "hello_watchpoint") @dsym_test def test_hello_watchpoint_with_dsym_using_watchpoint_set(self): """Test a simple sequence of watchpoint creation and watchpoint hit.""" self.buildDsym(dictionary=self.d) self.setTearDownCleanup(dictionary=self.d) self.hello_watchpoint() @dwarf_test def test_hello_watchpoint_with_dwarf_using_watchpoint_set(self): """Test a simple sequence of watchpoint creation and watchpoint hit.""" self.buildDwarf(dictionary=self.d) self.setTearDownCleanup(dictionary=self.d) self.hello_watchpoint() # Invocation -> [17:50:14] johnny:/Volumes/data/lldb/svn/ToT/test $ ./dotest.py -N dsym -v -p TestMyFirstWatchpoint.py LLDB build dir: /Volumes/data/lldb/svn/ToT/build/Debug LLDB-137 Path: /Volumes/data/lldb/svn/ToT URL: https://johnny@llvm.org/svn/llvm-project/lldb/trunk Repository Root: https://johnny@llvm.org/svn/llvm-project Repository UUID: 91177308-0d34-0410-b5e6-96231b3b80d8 Revision: 154133 Node Kind: directory Schedule: normal Last Changed Author: gclayton Last Changed Rev: 154109 Last Changed Date: 2012-04-05 10:43:02 -0700 (Thu, 05 Apr 2012) Session logs for test failures/errors/unexpected successes will go into directory '2012-04-05-17_50_49' Command invoked: python ./dotest.py -N dsym -v -p TestMyFirstWatchpoint.py compilers=['clang'] Configuration: arch=x86_64 compiler=clang ---------------------------------------------------------------------- Collected 2 tests 1: test_hello_watchpoint_with_dsym_using_watchpoint_set (TestMyFirstWatchpoint.HelloWatchpointTestCase) Test a simple sequence of watchpoint creation and watchpoint hit. ... skipped 'dsym tests' 2: test_hello_watchpoint_with_dwarf_using_watchpoint_set (TestMyFirstWatchpoint.HelloWatchpointTestCase) Test a simple sequence of watchpoint creation and watchpoint hit. ... ok ---------------------------------------------------------------------- Ran 2 tests in 1.138s OK (skipped=1) Session logs for test failures/errors/unexpected successes can be found in directory '2012-04-05-17_50_49' [17:50:50] johnny:/Volumes/data/lldb/svn/ToT/test $ llvm-svn: 154154
* Fixing an issue where Unicode characters in an NSString were printed as ↵Enrico Granata2012-03-291-1/+52
| | | | | | escape sequences by the summary provider shipping with LLDB - Added relevant test case code. Bonus points for identifying the source of the quotes :-) llvm-svn: 153624
* Fixing an issue where saying 'po foo' made both the summary and the ↵Enrico Granata2012-03-281-0/+6
| | | | | | description for foo come out. If one is po'ing something they most probably only care about the description - We will not omit the summary llvm-svn: 153608
* adding a summary for Objective-C type 'Class'Enrico Granata2012-03-271-0/+14
| | | | llvm-svn: 153541
* Removing cascading through inheritance chains for data formattersEnrico Granata2012-03-221-14/+0
| | | | | | | | | | | | | | | This is the feature that allowed the user to have things like: class Base { ... }; class Derived : public Base { ... }; and have formatters defined for Base work automatically for Derived. This feature turned out to be too expensive since it requires completing types. This patch takes care of removing cascading (other than typedefs chain cascading), updating the test suite accordingly, and adding required Cocoa class names to keep the AppKit formatters working llvm-svn: 153272
* Changed several of the Cocoa formatters to match the output style that Xcode ↵Enrico Granata2012-03-131-23/+23
| | | | | | | | | | | uses internally to provide summaries This has been done for those summaries where the difference is only cosmetic (e.g. naming things as items instead of values, ...) The LLDB output style has been preserved when it provides more information (e.g. telling the type as well as the value of an NSNumber) Test cases have been updated to reflect the updated output style where necessary llvm-svn: 152592
* added a new formatter for CF(Mutable)BitVectorEnrico Granata2012-03-031-0/+2
| | | | | | | | fixed a few potential NULL-pointer derefs in ValueObject we have a way to provide docstrings for properties we add to the SWIG layer - a few of these properties have a docstring already, more will come in future commits added a new bunch of properties to SBData to make it more natural and Python-like to access the data they contain llvm-svn: 151962
* (a) adding formatters for:Enrico Granata2012-03-021-1/+19
| | | | | | | | NSTimeZone and CFTimeZonRef SEL and related types CFGregorianDate llvm-svn: 151866
* (a) adding an introspection formatter for NS(Mutable)IndexSetEnrico Granata2012-03-011-4/+82
| | | | | | | | | (b) fixes and improvements to the formatters for NSDate and NSString (c) adding an introspection formatter for NSCountedSet (d) making the Objective-C formatters test cases pass on both 64 and 32 bit one of the test cases is marked as expected failure on i386 - support needs to be added to the LLDB core for it to pass llvm-svn: 151826
* This commit:Enrico Granata2012-02-291-5/+73
| | | | | | | | | | | | | a) adds a Python summary provider for NSDate b) changes the initialization for ScriptInterpreter so that we are not passing a bulk of Python-specific function pointers around c) provides a new ScriptInterpreterObject class that allows for ref-count safe wrapping of scripting objects on the C++ side d) contains much needed performance improvements: 1) the pointer to the Python function generating a scripted summary is now cached instead of looked up every time 2) redundant memory reads in the Python ObjC runtime wrapper are eliminated 3) summaries now use the m_summary_str in ValueObject to store their data instead of passing around ( == copying) an std::string object e) contains other minor fixes, such as adding descriptive error messages for some cases of summary generation failure llvm-svn: 151703
* Reworking the ObjC formatters test case not to test everything in one huge ↵Enrico Granata2012-02-241-13/+97
| | | | | | code block - better for maintenance and debugging llvm-svn: 151390
* This patch provides a set of formatters for most of the commonly used Cocoa ↵Enrico Granata2012-02-231-138/+81
| | | | | | | | | | classes. The formatter for NSString is an improved version of the one previously shipped as an example, the others are new in design and implementation. A more robust and OO-compliant Objective-C runtime wrapper is provided for runtime versions 1 and 2 on 32 and 64 bit. The formatters are contained in a category named "AppKit", which is not enabled at startup. llvm-svn: 151299
OpenPOWER on IntegriCloud