summaryrefslogtreecommitdiffstats
path: root/lldb/test/lang/objc/foundation
Commit message (Collapse)AuthorAgeFilesLines
* Move lldb/test to lldb/packages/Python/lldbsuite/test.Zachary Turner2015-10-2812-995/+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-277-7/+7
| | | | llvm-svn: 251444
* Port the python api decorator to use test categoriesPavel Labath2015-10-263-3/+3
| | | | | | | | | | | | | | | | | | 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-237-14/+28
| | | | | | | | | | | | | 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-227-54/+15
| | | | | | | | | | | | | | | | | | | | | 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
* Merge dwarf and dsym testsTamas Berghammer2015-09-307-269/+95
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Rename clang_type -> compiler_type for variables.Bruce Mitchener2015-09-241-2/+2
| | | | | | | | | | Reviewers: clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D13102 llvm-svn: 248461
* Fix a test case which was failing. There was no actual problem in the test ↵Enrico Granata2015-09-221-1/+1
| | | | | | logic, just a cosmetic issue with the presentation of the result by Foundation llvm-svn: 248339
* Reversed r238363, because the message is inconsistentSean Callanan2015-07-015-12/+12
| | | | | | with all the other assertion messages. llvm-svn: 241212
* [TestBase.runCmd] Better error message when runCmd fails.Siva Chandra2015-05-275-12/+12
| | | | | | | | | | | | | | | | | | | | | 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-307-8/+8
| | | | | | | | | | | | | | | | 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 this test case so it runs correctly.Greg Clayton2015-02-211-3/+5
| | | | | | <rdar://problem/19286788> llvm-svn: 230101
* Fixes for remote test suite execution of the "lldb/test/lang" directory.Greg Clayton2014-11-171-12/+23
| | | | | | | | | Fixes include: - Add a new lldbtest.TestBase function named registerSharedLibrariesWithTarget. This function can be called using the shared libraries for your test suite either as shared library basename ("foo"), path basename ("libfoo.dylib") or full path ("/tmp/lldb/test/lang/c/carp/libfoo.dylib"). These shared libraries are then registered with the target so they will be downloaded when the test is run remotely. - Changed a lot of tests over to use SBDebugger::CreateTarget(...) calls instead of using "file a.out" commands. - Cleaned up some tests to add new locations for breakpoints that all compilers should be able to abide by. Some tests and constants being loaded into values of structs and some compilers like arm64 will often combine two constant data loads into a single source line so some breakpoint locations were not being set correctly. Adding lines like 'puts("")' allow us to lock onto a source line that will have code. llvm-svn: 222156
* Fixed the an objective C test case so it passes correctly.Greg Clayton2014-07-161-4/+4
| | | | | | | | Fixed the test case to use a runtime function prototype that will be correct ([NSString stringWithCString: "new"]) instead of one that won't (expression str = [NSString stringWithFormat: @"%cew", 'N']). The runtime doesn't track vararg functions correctly so we can't reconstitute the function correctly. Also fixed some expressions that used "str_id" whose type was "id" and do the necessary casting since "id" doesn't have any methods. llvm-svn: 213113
* TestObjCMethods.FoundationTestCase was failing due to an error, fixed now.Greg Clayton2014-07-161-13/+16
| | | | | | | <rdar://problem/16322133> llvm.org/pr20267 llvm-svn: 213111
* Fix compile warning.Greg Clayton2014-07-151-1/+1
| | | | llvm-svn: 213106
* Marked TestObjCMethods failing tests XFAIL, fixed cleanup code, removed ↵Todd Fiala2014-07-092-3/+4
| | | | | | | | | | | | now-passing expected failure markers. All tests matching '-p TestObjCMethods' now are marked correctly for MacOSX, and some error classes have been removed in cleanup code looking for files that might not exist due to previous failure. See http://llvm.org/bugs/show_bug.cgi?id=20267 llvm-svn: 212650
* More recent compilers emit debug info for the length property of NSString, ↵Jim Ingham2014-03-201-1/+1
| | | | | | | | so the length will be correctly reported as NSUInteger. Adopt the test case to handle either possibility. llvm-svn: 204288
* Fixed a test suite failure on Darwin due to logging issues.Greg Clayton2014-02-131-1/+1
| | | | llvm-svn: 201356
* Removed spurious lookup of the $__lldb_exprSean Callanan2014-02-061-2/+0
| | | | | | | | | selector when compiling an expression in an Objective-C context. <rdar://problem/15797390> llvm-svn: 200950
* Fixed a test suite exception that was cause by bad python (sys.unlink ↵Greg Clayton2014-01-231-1/+1
| | | | | | instead of os.unlink). llvm-svn: 199952
* Make sure to cleanup the "dwarf-lookups.txt" log file.Greg Clayton2014-01-111-1/+7
| | | | llvm-svn: 198984
* We are doing spurious name lookups when running expressions in objective C ↵Greg Clayton2014-01-111-0/+42
| | | | | | | | | | methods. <rdar://problem/15797390> This new test case will detect this and make sure we don't regress on global name lookups that search all DWARF for everything when we don't need to. llvm-svn: 198982
* Correctly set the working directory when launching processes for both local ↵Greg Clayton2013-12-133-3/+3
| | | | | | and remote targets. llvm-svn: 197266
* Massive test suite cleanup to stop everyone from manually having to compute ↵Greg Clayton2013-12-107-7/+7
| | | | | | | | | | "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
* <rdar://problem/12362092>Enrico Granata2013-02-231-4/+2
| | | | | | | | The decorators @expectedFailure (plain and special-case like i386, clang, ...) are modified to optionally take a bugnumber argument If such an argument is specified, the failure report (or unexpected success report) will include the information passed in as part of the message This is mostly useful for associating failures to issue IDs in issue management systems (e.g. the LLVM bugzilla) llvm-svn: 175942
* <rdar://problem/12890171>Enrico Granata2013-01-291-1/+1
| | | | | | | | Providing a compact display mode for "po" to use where the convenience variable name and the pointer value are both hidden. This is for convenience when dealing with ObjC instances where the description often gets it right and the debugger-provided information is not useful to most people. If you need either of these, "expr" will still show them. llvm-svn: 173748
* <rdar://problem/12028723>Enrico Granata2013-01-091-1/+1
| | | | | | | | | | 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/12953853>Greg Clayton2013-01-082-2/+2
| | | | | | | | | | Setting breakpoints using "breakpoint set --selector <SEL>" previously didn't when there was no dSYM file. Also fixed issues in the test suite that arose after fixing the bug. Also fixed the log channels to properly ref count the log streams using weak pointers to the streams. This fixes a test suite problem that would happen when you specified a full path to the compiler with the "--compiler" option. llvm-svn: 171816
* This patch removes the SymbolFileSymtab support Sean Callanan2012-12-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | for reporting class types from Objective-C runtime class symbols. Instead, LLDB now queries the Objective-C runtime for class types. We have also added a (minimal) Objective-C runtime type vendor for Objective-C runtime version 1, to prevent regressions when calling class methods in the V1 runtime. Other components of this fix include: - We search the Objective-C runtime in a few more places. - We enable enumeration of all members of Objective-C classes, which Clang does in certain circumstances. - SBTarget::FindFirstType and SBTarget::FindTypes now query the Objective-C runtime as needed. - I fixed several test cases. <rdar://problem/12885034> llvm-svn: 170601
* Option changes:Enrico Granata2012-12-121-1/+1
| | | | | | | | | | | | | | | | | 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/12798131> Greg Clayton2012-12-041-4/+4
| | | | | | | | | | | | Cleaned up the option parsing code to always pass around the short options as integers. Previously we cast this down to "char" and lost some information. I recently added an assert that would detect duplicate short character options which was firing during the test suite. This fix does the following: - make sure all short options are treated as "int" - make sure that short options can be non-printable values when a short option is not required or when an option group is mixed into many commands and a short option is not desired - fix the help printing to "do the right thing" in all cases. Previously if there were duplicate short character options, it would just not emit help for the duplicates - fix option parsing when there are duplicates to parse options correctly. Previously the option parsing, when done for an OptionGroup, would just start parsing options incorrectly by omitting table entries and it would end up setting the wrong option value llvm-svn: 169189
* Update test status on LinuxDaniel Malea2012-11-231-0/+1
| | | | | | | | | - add decorators @expectedFailLinux and @skipOnLinux - skip/mark xfail cases due to open bugzillas # 14323, 14416, 14423, 14424, 14425, 14426 Patch by Ashok Thirumurthi! llvm-svn: 168529
* Added a testcase for runtime types in Objective-C.Sean Callanan2012-10-231-0/+62
| | | | llvm-svn: 166507
* Missed a few places where I didn't delete the obsolete (commented out) ↵Jim Ingham2012-09-223-39/+2
| | | | | | version of the breakpoint creation. llvm-svn: 164436
* Fix all the test case breakages caused by folks writing tests all over the ↵Jim Ingham2012-09-225-53/+75
| | | | | | | | place that depended explicitly on the output of "break set". Please don't do this sort of thing!!!!! llvm-svn: 164433
* <rdar://problem/11505459> Stripping off the object's type from the output of ↵Enrico Granata2012-08-091-1/+1
| | | | | | the 'po' command llvm-svn: 161592
* Add i386-only expectedFailure decorators for current ToT.Johnny Chen2012-05-151-0/+2
| | | | llvm-svn: 156855
* Changed some tabs to spaces to make Python likeSean Callanan2012-04-061-24/+24
| | | | | | this file. llvm-svn: 154222
* Second batch of adding @dsym_test/@dwarf_test decorators to existing test cases.Johnny Chen2012-04-066-0/+26
| | | | | | | Plus some minor cleanup of test method names. Third and final batch is coming. llvm-svn: 154197
* Remove @expectedFailure decorators as the bug has been fixed.Johnny Chen2012-02-141-2/+2
| | | | llvm-svn: 150501
* Add test cases exercising SBValue.GetObjectDescription() with the SBValue ↵Johnny Chen2012-02-142-0/+90
| | | | | | | | from SBTarget.FindGlobalVariables() as well as from SBFrame.GetVariables(). Both scenarios are expected to work. llvm-svn: 150450
* Fixed a problem in our local Clang's method forSean Callanan2012-01-051-0/+4
| | | | | | | | | | | | performing Objective-C instance variable lookup. Previously, it only completed the derived class that was the beginning of the search. Now, as it walks up the superclass chain looking for the ivar, it completes each superclass in turn. Also added a testcase covering this issue. llvm-svn: 147621
* The "desired result type" code in the expressionSean Callanan2011-12-211-0/+28
| | | | | | | | | | | | | | | | | | | | | | parser has hitherto been an implementation waiting for a use. I have now tied the '-o' option for the expression command -- which indicates that the result is an Objective-C object and needs to be printed -- to the ExpressionParser, which communicates the desired type to Clang. Now, if the result of an expression is determined by an Objective-C method call for which there is no type information, that result is implicitly cast to id if and only if the -o option is passed to the expression command. (Otherwise if there is no explicit cast Clang will issue an error. This behavior is identical to what happened before r146756.) Also added a testcase for -o enabled and disabled. llvm-svn: 147099
* Updated Clang to take an enhancement to the waySean Callanan2011-12-161-0/+27
| | | | | | | | | | | | | | we handle Objective-C method calls. Currently, LLDB treats the result of an Objective-C method as unknown if the type information doesn't have the method's signature. Now Clang can cast the result to id if it isn't explicitly cast. I also added a test case for this, as well as a fix for a type import problem that this feature exposed. llvm-svn: 146756
* Added the ability to dereference an Objective-C objectSean Callanan2011-12-081-1/+28
| | | | | | | | | | | | | pointer to make the result of an expression. LLDB now dumps the ivars of the Objective-C object and all of its parents. This just required fixing a bug where we didn't distinguish between Objective-C object pointers and regular C-style pointers. Also added a testcase to verify that this continues to work. llvm-svn: 146164
* Cleaned up the SBType.h file to not include internal headers and reorganizedGreg Clayton2011-08-031-2/+2
| | | | | | | | | | | | | | | | | | the SBType implementation classes. Fixed LLDB core and the test suite to not use deprecated SBValue APIs. Added a few new APIs to SBValue: int64_t SBValue::GetValueAsSigned(int64_t fail_value=0); uint64_t SBValue::GetValueAsUnsigned(uint64_t fail_value=0) llvm-svn: 136829
* Passing in os.ctermid() as the arg for SBTarget.Launch(...) for stdin_path, ↵Johnny Chen2011-07-111-2/+1
| | | | | | | | | | | | stdout_path, and stderr_path is just wrong and resulted in the inferior's output getting mixed into the GDB remote communication's log file. Change all test cases to not pass os.ctermid() and either use SBTarget.LaunchSimple() or SBTarget.Launch() and pass None as stdin_path/stdout_path/srderr_path to use a pseudo terminal. rdar://problem/9716499 program output is getting mixed into the GDB remote communications llvm-svn: 134940
* Centralize all of the type name code so that we always strip the leadingGreg Clayton2011-06-301-1/+1
| | | | | | | | "struct ", "class ", and "union " from the start of any type names that are extracted from clang QualType objects. I had to fix test suite cases that were expecting the struct/union/class prefix to be there. llvm-svn: 134132
* Add @expectedFailure for TestCallStdStringFunction.py (radar was filed) andJohnny Chen2011-06-281-1/+0
| | | | | | | remove @expectedFailure from TestObjCMethods.py's print_ivars_correctly() function (it has been passing for a while). llvm-svn: 134022
OpenPOWER on IntegriCloud