summaryrefslogtreecommitdiffstats
path: root/lldb/test/functionalities/data-formatter
Commit message (Collapse)AuthorAgeFilesLines
* Move lldb/test to lldb/packages/Python/lldbsuite/test.Zachary Turner2015-10-28178-10451/+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-2753-53/+53
| | | | llvm-svn: 251444
* Convert deprecated unittest method names.Zachary Turner2015-10-261-2/+2
| | | | | | | Plural methods were long deprecated, and in Python 3 they are gone. Convert to the actual supported method names. llvm-svn: 251303
* Port the python api decorator to use test categoriesPavel Labath2015-10-261-0/+1
| | | | | | | | | | | | | | | | | | Summary: Per discussions on the mailing list, I have implemented a decorator which annotates individual test methods with categories. I have used this framework to replace the '-a' and '+a' command-line switches (now '-G pyapi' and '--skip-category pyapi') and the @python_api_test decorator (now @add_test_categories('pyapi')). The test suite now gives an error message suggesting the new options if the user specifies the deprecated +/-a switches. If the general direction is good, I will follow this up with other switches. Reviewers: tberghammer, tfiala, granata.enrico, zturner Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D14020 llvm-svn: 251277
* Add from __future__ import print_function everywhere.Zachary Turner2015-10-2353-8/+114
| | | | | | | | | | | | | 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
* Enable the libc++ tests on linuxPavel Labath2015-10-239-18/+18
| | | | | | | | | | | | | | | Summary: The list of loaded modules which skip_if_library_missing is depending on is not available on linux until after we run the target. This causes the tests to be wrongfully skipped. This commit moves the skip call after the run command. Reviewers: granata.enrico, tfiala Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D13985 llvm-svn: 251102
* Update every test to import `lldb_shared`.Zachary Turner2015-10-2253-390/+106
| | | | | | | | | | | | | | | | | | | | | 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
* Fix libstdc++ data formatters on Ubuntu 15.10 x86_64Todd Fiala2015-10-222-13/+15
| | | | | | See http://reviews.llvm.org/D13964 for details. llvm-svn: 250965
* [SBValue] Add a method GetNumChildren(uint32_t max)Siva Chandra2015-10-213-0/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Along with this, support for an optional argument to the "num_children" method of a Python synthetic child provider has also been added. These have been added with the following use case in mind: Synthetic child providers currently have a method "has_children" and "num_children". While the former is good enough to know if there are children, it does not give any insight into how many children there are. Though the latter serves this purpose, calculating the number for children of a data structure could be an O(N) operation if the data structure has N children. The new method added in this change provide a middle ground. One can call GetNumChildren(K) to know if a child exists at an index K which can be as large as the callers tolerance can be. If the caller wants to know about children beyond K, it can make an other call with 2K. If the synthetic child provider maintains state about it counting till K previosly, then the next call is only an O(K) operation. Infact, all calls made progressively with steps of K will be O(K) operations. Reviewers: vharron, clayborg, granata.enrico Subscribers: labath, lldb-commits Differential Revision: http://reviews.llvm.org/D13778 llvm-svn: 250930
* [DataFormatters] Make libc++ list loop detection linearPavel Labath2015-10-213-0/+91
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: Loop detection code is being called before every element access. Although it tries to cache some of the data by remembering the loop-free initial segment, every time it needs to increase this segment, it will start from scratch. For the typical usage pattern, where one accesses the elements in order, the loop detection will need to be run after every access, resulting in quadratic behavior. This behavior is noticable even for the default 255 element limit. In this commit, I rewrite the algorithm to be truly incremental -- it maintains the state of its loop-detection runners between calls, and reuses them when it needs to check another segment. This way, each part of the list is scanned only once, resulting in linear behavior. Also note that I have changed the operator== of ListEntry to do the comparison based on the value() function (instead of relying on ValueObjectSP equality). In my experiments, I kept getting different ValueObjectSPs when going through the same element twice. Reviewers: granata.enrico Subscribers: lldb-commits, sivachandra Differential Revision: http://reviews.llvm.org/D13902 llvm-svn: 250890
* Adjust TestCompletion.py and TestDumpDynamic.py after recent changes.Siva Chandra2015-10-201-1/+1
| | | | | | | | | | Reviewers: zturner, spyffe Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D13882 llvm-svn: 250782
* 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-077-36/+36
| | | | | | | | | 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
* Rename a test case to avoid name conflictTamas Berghammer2015-10-061-0/+0
| | | | | | | | | Rename the python source file for DataFormatterOSTypeTestCase to match the purpose of the test and to avoid a name conflict with DataFormatterBoolRefPtr. The name conflict caused a race condition in the test runner what we have to address separately. llvm-svn: 249407
* Merge dwarf and dsym testsTamas Berghammer2015-09-3052-914/+182
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Make libc++ tests skip themselves if libc++ is not actually loaded in the targetEnrico Granata2015-09-1811-1/+23
| | | | llvm-svn: 248028
* Add the ability for formatter categories to be bound to one or more languagesEnrico Granata2015-09-172-9/+7
| | | | | | What that does is it restricts formatters in those categories to only match to types coming from "compatible" source languages llvm-svn: 247872
* Add missed import lldbtest.Oleksiy Vyalov2015-09-111-0/+1
| | | | llvm-svn: 247469
* XFAIL some more tests related to value apiZachary Turner2015-09-111-1/+1
| | | | | | llvm.org/pr24772 llvm-svn: 247458
* Move the C++ data formatters to the C++ language pluginEnrico Granata2015-09-041-5/+5
| | | | llvm-svn: 246873
* Lookup function using full name if one with mangled name is not found.Siva Chandra2015-09-031-1/+0
| | | | | | | | | | | | | | Summary: Remove expected failure decorators from tests which now should start passing. Reviewers: clayborg, spyffe Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D12613 llvm-svn: 246820
* XFAIL more bugs that depend on dynamic value resolution.Zachary Turner2015-09-021-1/+1
| | | | | | llvm.org/pr24663 llvm-svn: 246724
* Rename all functionalities/data-formatter test case with radar bug numbers ↵Enrico Granata2015-08-2543-128/+11
| | | | | | in them to more meaningful names llvm-svn: 245993
* XFAIL some data formatter tests on Windows.Zachary Turner2015-08-145-0/+5
| | | | | | Fixing these bugs is tracked by http://llvm.org/pr24462. llvm-svn: 245126
* Disable libstdc++ and libcxx data formatter tests on Windows.Zachary Turner2015-08-148-4/+9
| | | | | | | | | | Neither of these libraries has been ported to Windows. Eventually if they are ever ported we can re-enable these tests. But more immediately what we need to do is add new data formatters for MSVC's STL implementation. This is tracked in http://llvm.org/pr24460. llvm-svn: 245125
* Fix a bug where the std::list synthetic child provider would not clean its ↵Enrico Granata2015-07-282-2/+26
| | | | | | | | cache correctly on update, causing stale children to be returned in some circumstances Fixes rdar://20560680 llvm-svn: 243472
* Add option eTypeOptionHideEmptyAggregates.Siva Chandra2015-07-242-0/+9
| | | | | | | | | | | | | | | | | | Summary: For certain data structures, when the synthetic child provider returns zero children, a summary like "Empty instance of <typename>" could be more appropriate than something like "size=0 {}". This new option helps hide the trailing "{}". This is also exposed with a -h option for the command "type summary add". Reviewers: granata.enrico Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D11473 llvm-svn: 243166
* Teach the NSString data formatter to handle embedded NULs in short ASCII stringsEnrico Granata2015-07-172-0/+26
| | | | llvm-svn: 242559
* Improve the NSString data formatter so that explicitly-lengthed Unicode ↵Enrico Granata2015-07-172-0/+11
| | | | | | strings print embedded NULs correctly llvm-svn: 242555
* Split the portion of the data-formatter-objc test case that deals with ↵Enrico Granata2015-07-174-85/+203
| | | | | | NSString into its own separate test case llvm-svn: 242552
* Teach the std::wstring data formatter how to properly display strings with ↵Enrico Granata2015-07-172-2/+5
| | | | | | embedded NUL bytes llvm-svn: 242501
* Add StringPrinter support for printing a std::string with embedded NUL bytesEnrico Granata2015-07-172-2/+5
| | | | llvm-svn: 242496
* Add a summary for vector typesEnrico Granata2015-07-071-2/+3
| | | | | | | | | | | | The summary is - quite simply - a one-line printout of the vector elements We still need synthetic children: a) as a source of the elements to print in the summary b) for graphical IDEs that display structure regardless of the summary settings rdar://5429347 llvm-svn: 241531
* Reversed r238363, because the message is inconsistentSean Callanan2015-07-0151-58/+58
| | | | | | with all the other assertion messages. llvm-svn: 241212
* Revert r239873 - I actually want to think some more about thisEnrico Granata2015-06-172-4/+0
| | | | llvm-svn: 239874
* Fix an issue where the oneliner printing of variables would ignore custom ↵Enrico Granata2015-06-172-0/+4
| | | | | | | | | | | formatting Because vector types use their formats in special ways (i.e. children get generated based on them), this change by itself would cause a regression in printing vector types with some custom formats Work around that issue by special casing vector types out of this format-passdown mode. I believe there is a more general feature to be designed in this space, but until I see more cases of interest, I am going to leave this as a special case Fixes rdar://20810062 llvm-svn: 239873
* Fix a bug where trying to Dump() a ValueObject would use the ↵Enrico Granata2015-06-033-0/+50
| | | | | | | | | | static/non-synthetic version of the value even if the ValueObject one actually called Dump() on turned out to be dynamic and/or synthetic This was of course overridable by using DumpValueObjectOptions, but the default should be saner and the previous behavior made for a few fun investigations.... rdar://problem/21065149 llvm-svn: 238961
* Use wildcard instead of relying on shell globbing.Chaoren Lin2015-06-021-2/+1
| | | | | | | | | | Reviewers: clayborg, zturner Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D10194 llvm-svn: 238859
* Simplify regex in TestDataFormatterUnordered.py for better readability.Chaoren Lin2015-05-281-6/+22
| | | | | | | | | | | | | | | | | | Summary: Using `(match){3}` instead of `matchmatchmatch`. This is an update to D10078. Test Plan: no change in test behavior. Reviewers: clayborg, sivachandra Reviewed By: sivachandra Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D10094 llvm-svn: 238510
* [TestDataFormatterUnordered] Use patterns to match unordered_<multi>set elementsSiva Chandra2015-05-281-8/+8
| | | | | | | | | | | | | | | | Summary: This fixes the test for i386 targets. Test Plan: dotest.py -C clang --arch i386 TestDataFormatterUnordered Reviewers: chying, chaoren, clayborg Reviewed By: clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D10078 llvm-svn: 238385
* [TestBase.runCmd] Better error message when runCmd fails.Siva Chandra2015-05-2751-58/+58
| | | | | | | | | | | | | | | | | | | | | 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
* [TestDataFormatterUnordered] Fix a few typos in the test.Siva Chandra2015-05-271-2/+2
| | | | | | | | | | | | | | | | Summary: The typos were exposed by http://reviews.llvm.org/D9948. Test Plan: dotest.py -p TestDataFormatterUnordered Reviewers: vharron, clayborg Reviewed By: clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D10071 llvm-svn: 238361
* Make it so that changing formats on a synthetic value object causes children ↵Enrico Granata2015-05-071-0/+9
| | | | | | | | to be invalidated and refetched when needed This is required for supporting vector types formatting llvm-svn: 236769
* Mark TestTypedefArray as XFAIL with Gcc.Oleksiy Vyalov2015-05-041-1/+2
| | | | llvm-svn: 236425
* Enabled libc++ formatter tests on LinuxVince Harron2015-05-0422-41/+88
| | | | | | | | | | Refactored TestInitializerList to not be an inline test. Refactored Makefiles to use USE_LIBCPP instead of adding FLAGS directly Fixed copy/paste error in TestDataFormatterUnordered class name Differenttial Revision: http://reviews.llvm.org/D9426 llvm-svn: 236401
* XFAIL tests that are failed on linux with gcc-4.9.2Ying Chen2015-04-212-1/+2
| | | | | | | | | | | | | | | | | | | Summary: - add decorator functions to xfail and skip test on specific os, architecture and version of comipler - xfail failing test with gcc-4.9.2 on linux - add one usage of skipIf function Test Plan: Run tests with different archs, and version of compilers to verify decorator function working as expected Run tests with gcc-4.9.2 and no failure reported Reviewers: sivachandra, ovyalov, vharron, chaoren Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D8851 llvm-svn: 235368
* Add Makefile for typedef_arrayYing Chen2015-04-201-0/+4
| | | | | | | | | | | | | | | | -Makefile was deleted by r235313 causing test failure of TestTypedefArray.py, add it back Summary: -Makefile was deleted by r235313 causing test failure of TestTypedefArray.py, add it back Test Plan: Run lldb test locally with change, TestTypedefArray.py passed and no regression observed. Reviewers: chaoren, sivachandra, vharron Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D9119 llvm-svn: 235346
* This patch implements several improvements to theSean Callanan2015-04-201-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | module-loading support for the expression parser. - It adds support for auto-loading modules referred to by a compile unit. These references are currently in the form of empty translation units. This functionality is gated by the setting target.auto-import-clang-modules (boolean) = false - It improves and corrects support for loading macros from modules, currently by textually pasting all #defines into the user's expression. The improvements center around including only those modules that are relevant to the current context - hand-loaded modules and the modules that are imported from the current compile unit. - It adds an "opt-in" mechanism for all of this functionality. Modules have to be explicitly imported (via @import) or auto-loaded (by enabling the above setting) to enable any of this functionality. It also adds support to the compile unit and symbol file code to deal with empty translation units that indicate module imports, and plumbs this through to the CompileUnit interface. Finally, it makes the following changes to the test suite: - It adds a testcase that verifies that modules are automatically loaded when the appropriate setting is enabled (lang/objc/modules-auto-import); and - It modifies lanb/objc/modules-incomplete to test the case where a module #undefs something that is #defined in another module. <rdar://problem/20299554> llvm-svn: 235313
* Skip libc++ data formmatting tests on Windows. libc++ hasn't been ported to ↵Adrian McCarthy2015-04-138-0/+8
| | | | | | windows yet. llvm-svn: 234794
OpenPOWER on IntegriCloud