summaryrefslogtreecommitdiffstats
path: root/lldb/test/lang/objc
Commit message (Collapse)AuthorAgeFilesLines
* Move lldb/test to lldb/packages/Python/lldbsuite/test.Zachary Turner2015-10-28140-5376/+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-2739-39/+39
| | | | llvm-svn: 251444
* Port the python api decorator to use test categoriesPavel Labath2015-10-2618-18/+18
| | | | | | | | | | | | | | | | | | 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-2339-22/+100
| | | | | | | | | | | | | 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-2240-288/+85
| | | | | | | | | | | | | | | | | | | | | 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 test for change in a summary string (objects -> elements).Jim Ingham2015-10-121-6/+6
| | | | llvm-svn: 250081
* Another stripped test that requires darwin and a dSYM (no Dwarf or DWO).Greg Clayton2015-10-071-0/+2
| | | | llvm-svn: 249605
* More fixes for binaries that we strip. When we strip a binary we can't do ↵Greg Clayton2015-10-071-0/+4
| | | | | | Dwarf or DWO. llvm-svn: 249604
* Fix a test that should only be run with a dSYM file by adding @skipIfDwarf ↵Greg Clayton2015-10-071-0/+2
| | | | | | and using a new @skipIfDWO. llvm-svn: 249601
* Merge dwarf and dsym testsTamas Berghammer2015-09-3040-1010/+304
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* OS X unexpected success cleanupTodd Fiala2015-09-141-2/+4
| | | | | | | | | | TestPersistObjCPointeeType and TestObjCNewSyntax marked up to expect success on clang >= 7.0.0. TestMultipleDebuggers passed 25/25 times, taking off intermittent. If this changes, I'll make sure it goes into a flaky/flakey category. llvm-svn: 247601
* Skip the rest of the Objective C tests on Windows.Zachary Turner2015-09-023-0/+3
| | | | llvm-svn: 246726
* Disable Objective C test on non-Darwin platforms.Zachary Turner2015-08-261-2/+1
| | | | llvm-svn: 246060
* Reversed r238363, because the message is inconsistentSean Callanan2015-07-0120-30/+30
| | | | | | with all the other assertion messages. llvm-svn: 241212
* Fix a bug where we were trying to reconstruct ivars of ObjC types from the ↵Enrico Granata2015-06-255-0/+116
| | | | | | | | | | | | | | runtime in "expression parser mode" The expression parser mode allows UnknownAnyTy to make it all the way through, but that is bad for ivars because it means type layout fails horribly (as in, clang crashes) This patch fixes the issue by using the "variables view mode", which masks UnknownAnyTy as empty-type, and pointer-to UnknownAnyTy as void* This, in turn, allows LLDB to properly reconstruct ivars of IMP type in ObjC type - as per accompanying test case Fixes rdar://21471326 llvm-svn: 240677
* [TestBase.runCmd] Better error message when runCmd fails.Siva Chandra2015-05-2720-30/+30
| | | | | | | | | | | | | | | | | | | | | 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
* Working on getting the OSX build greenVince Harron2015-05-122-0/+3
| | | | | | | | | | | | | | Added missing SBLanguageRuntime.h to lldb.xcodeproj, set to Public (fixed compile error in TestPublicAPIHeaders) Removed reference to (temporarily) missing gtest.xcodeproj Fixed TestDeadStrip compile error XFAIL TestPublicAPIHeaders - test passes but teardown command 'settings remove target.env-vars DYLD_LIBRARY_PATH' fails XFAIL TestCModules - use of undeclared identifier 'MIN' XFAIL TestModulesAutoImport - clang: error: unknown argument: '-gmodules' XFAIL TestObjCNewSyntax - expr -- @((char*)"Hello world" + 6) cannot box a string value because NSString has not been declared http://reviews.llvm.org/D9643 llvm-svn: 237085
* Added support for locating and importing functionsSean Callanan2015-05-016-0/+116
| | | | | | | | | | | | (including inline functions) from modules in the expression parser. We now have to retain a reference to the code generator in ClangExpressionDeclMap so that any imported function bodies can be appropriately sent to that code generator. <rdar://problem/19883002> llvm-svn: 236297
* This patch implements several improvements to theSean Callanan2015-04-205-0/+99
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Added a testcase that checks that struct argumentsSean Callanan2015-04-073-0/+113
| | | | | | are passed to Objective-C methods correctly. llvm-svn: 234351
* Fixed a problem where the second @import statementSean Callanan2015-04-071-1/+7
| | | | | | | | | | | | in a session would be silently ignored by the compiler because the compiler looked at its SourceLocation and decided it had already handled it. Also updated the relevant test case. <rdar://problem/20315447> llvm-svn: 234330
* Marked the modules tests as expected failures,Sean Callanan2015-04-032-0/+4
| | | | | | | | because the OS X builders aren't happy with them. <rdar://problem/20416388> llvm-svn: 234028
* A new testcase had a silly integer-value mismatch.Sean Callanan2015-04-031-1/+1
| | | | | | Fixed that. llvm-svn: 234023
* Added a testcase that covers loading a module andSean Callanan2015-04-036-0/+123
| | | | | | | | | | | verifying that the types from that module don't override types from DWARF. Also added a target setting to LLDB so we can tell Clang where to look for these local modules. <rdar://problem/18805055> llvm-svn: 234016
* Add checks to the modules test case to ensureSean Callanan2015-04-021-0/+6
| | | | | | | that module types and runtime types play well together. llvm-svn: 233976
* Update sys.platform switched behavior in tests to use self.getPlatform ↵Robert Flack2015-04-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | (remote target platform) Uses target platform when determining which platform specific behavior to use or expect in tests. TestHelp.py was unchanged because this is asserting behavior of the local lldb binary. Test Plan: Run tests on different remote os. Several previously failing tests now pass: TestArrayTypes.py TestInferiorChanged.py TestInferiorCrashing.py TestIvarProtocols.py TestProcessIO.py TestPublicAPIHeaders.py TestRecursiveInferior.py Differential Revision: http://reviews.llvm.org/D8747 llvm-svn: 233805
* Replace sys.platform skips in tests with @skip decorators which check ↵Robert Flack2015-03-3034-58/+58
| | | | | | | | | | | | | | | | 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
* Added a testcase that verifies that LLDB can loadSean Callanan2015-03-273-0/+100
| | | | | | | | | Clang modules out of the Mac OS X SDK and use their types/functions. <rdar://problem/18802064> llvm-svn: 233421
* Fix this test case so it runs correctly.Greg Clayton2015-02-211-3/+5
| | | | | | <rdar://problem/19286788> llvm-svn: 230101
* If a binary was stripped we sometimes didn't show the ivars of an Objective ↵Greg Clayton2014-12-162-31/+101
| | | | | | | | | | | | | | C class correctly. Now we do as we consult the runtime data for the class so we don't have to have a symbol in the symbol table. Fixed: 1 - try the symbol table symbol for an ObjC ivar and use it if available 2 - fall back to using the runtime data since it is slower to gather via memory read 3 - Fixed our hidden ivars test case to test this to ensure we don't regress 4 - split out a test case in the hidden ivars to cover only the part that was failing so we don't have an expected failure for all of the other content in the test. <rdar://problem/18882687> llvm-svn: 224306
* Fixes for remote test suite execution of the "lldb/test/lang" directory.Greg Clayton2014-11-175-24/+63
| | | | | | | | | 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
* Fix so this test runs successfully on armv7 devices.Greg Clayton2014-11-121-1/+1
| | | | llvm-svn: 221830
* Add a makefile even though it isn't used by the test in case we need to ↵Greg Clayton2014-11-121-0/+6
| | | | | | debug it when it fails. llvm-svn: 221828
* Fixes so tests compile and run remotely.Greg Clayton2014-11-0610-38/+51
| | | | | | | | | | Fixes include: - dont set or change LDFLAGS, but set LD_EXTRAS instead - fix compilation errors for iOS based builds with objective C code - fix test cases to create classes instead of relying on classes from AppKit - rename things where it makes sense llvm-svn: 221496
* Handle types from the runtime that conform toSean Callanan2014-11-062-0/+37
| | | | | | | | protocols. <rdar://problem/18883778> llvm-svn: 221476
* Fixed the Objective-C stripped ivar test to ensureSean Callanan2014-11-051-0/+2
| | | | | | | | | | | that we load debug information properly. If we don't explicitly add-dsym, sometimes Spotlight will help out and tell us about the dSYM but we shouldn't be relying on that. Thanks to Jim for catching this. <rdar://problem/16424661> llvm-svn: 221400
* Added a test case for reading ivars from theSean Callanan2014-11-042-0/+14
| | | | | | | | Objective-C runtime. We'll need to do more (subclasses, partially-defined classes, etc.) but this tests that at least the basics work. llvm-svn: 221208
* Skip ObjC test on FreeBSD that does not buildEd Maste2014-10-271-0/+1
| | | | llvm-svn: 220681
* Skip dsym test on !DarwinEd Maste2014-10-201-0/+1
| | | | | | | | | | | r219978 fixed this test to work on Darwin, and removed the expected failure decorator, but it then started running (and failing) on FreeBSD. I'd think @dsym_test should skip the test on all non-Darwin operating systems. It seems not to be the case, so for now skip it the same way as done for other @dsym_test tests. llvm-svn: 220219
* Fixed the expression parser to handle cases whereSean Callanan2014-10-171-2/+0
| | | | | | | | | GetValueForVariableExpressionPath returns NULL and doesn't set an error. <rdar://problem/18682916> llvm-svn: 220070
* Don't enable the log here. It was just me debuggingEnrico Granata2014-10-171-1/+0
| | | | llvm-svn: 220011
* Some more test markingEnrico Granata2014-10-161-4/+5
| | | | llvm-svn: 219981
* Fix this test case to actually work - it was relying on a certain 'po' ↵Enrico Granata2014-10-162-14/+12
| | | | | | output which wasn't occurring llvm-svn: 219978
* Some more failure to bug trackingEnrico Granata2014-10-161-2/+2
| | | | llvm-svn: 219973
* I see this test case crash - skip for nowEnrico Granata2014-10-161-0/+2
| | | | llvm-svn: 219970
* Fixed the objective C symbol parsing in ObjectFileMachO.Greg Clayton2014-07-173-8/+0
| | | | | | | | | | | | | This fixes all of the hidden ivar test cases and any case where we try to find the full definition of an objective C class. This also means hidden ivars show up again. <rdar://problem/15458957> llvm.org/pr20270 llvm.org/pr20269 llvm.org/pr20272 llvm-svn: 213328
* 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
OpenPOWER on IntegriCloud