summaryrefslogtreecommitdiffstats
path: root/lldb/test/lang/c
Commit message (Collapse)AuthorAgeFilesLines
* Move lldb/test to lldb/packages/Python/lldbsuite/test.Zachary Turner2015-10-2875-2871/+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-2718-18/+18
| | | | llvm-svn: 251444
* Convert `long` to `int`, and portably detect all integral types.Zachary Turner2015-10-261-1/+1
| | | | llvm-svn: 251305
* 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-2318-0/+36
| | | | | | | | | | | | | 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-2219-136/+38
| | | | | | | | | | | | | | | | | | | | | 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
* Testcase and fix for bug 24074Ravitheja Addepally2015-10-083-0/+96
| | | | | | | | | | | | | | | | | | | | Summary: In bug 24074, the type information is not shown correctly. This commit includes the following - -> Changes for displaying correct type based on current lexical scope for the command "image lookup -t" -> The corresponding testcase. -> This patch was reverted due to segfaults in FreeBSD and Mac, I fixed the problems for both now. Reviewers: emaste, granata.enrico, jingham, clayborg Differential Revision: http://reviews.llvm.org/D13290 llvm-svn: 249673
* Merge dwarf and dsym testsTamas Berghammer2015-09-3018-530/+181
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Revert 248366 "Testcase and fix for bug 24074"Enrico Granata2015-09-233-96/+0
| | | | | | This commit introduced regressions in several test cases on FreeBSD and Mac OS X llvm-svn: 248421
* Testcase and fix for bug 24074Ravitheja Addepally2015-09-233-0/+96
| | | | | | | | | | | | | | | | Summary: In bug 24074, the type information is not shown correctly. This commit includes the following - -> Changes for displaying correct type based on current lexical scope for the command "image lookup -t" -> The corresponding testcase. Reviewers: jingham, ovyalov, spyffe, richard.mitton, clayborg Differential Revision: http://reviews.llvm.org/D12404 llvm-svn: 248366
* Remove expectedFailureFreeBSD from passing test_expr_null_with_dwarfEd Maste2015-09-221-1/+0
| | | | | | llvm.org/pr21550 llvm-svn: 248236
* Last set of XFAILs for Windows.Zachary Turner2015-09-161-0/+2
| | | | llvm-svn: 247825
* Add support for DW_OP_GNU_const_index to dwarf expressionTamas Berghammer2015-09-151-1/+1
| | | | | | | | DW_OP_GNU_const_index is a new opcode used when split dwarf is enabled Differential revision: http://reviews.llvm.org/D12849 llvm-svn: 247672
* Fixed up TestConstVariables for Linux/FreeBSD, take 2.Todd Fiala2015-09-151-1/+9
| | | | | | | | | | | Marked XFAIL for: clang - all versions < 3.5. I verified the first version it passes on Linux is 3.5. clang - version 3.7 (verified this fails) clang - TOT/3.8 (verified this currently fails) Ideally we dig into why this started failing and (hopefully) get this passing again. llvm-svn: 247664
* Revert "Fixup XFAIL marking on TestConstVariables for clang version"Chaoren Lin2015-09-151-3/+1
| | | | | | | | | | | | | | | Summary: Linux with ToT clang (3.8) fails. This reverts commit r247633. Reviewers: tfiala Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D12868 llvm-svn: 247648
* Fixup XFAIL marking on TestConstVariables for clang versionTodd Fiala2015-09-141-1/+3
| | | | | | | | | | Linux/clang on clang 3.6+ is passing this test. As OS X was in a similar position, I'm guessing this was fixed by a recent compiler. Might work on 3.5/3.4, but it is definitely working on clang 3.6. I didn't break out FreeBSD since this appears to be related to a compiler fix. llvm-svn: 247633
* Another round of macosx unexpected success corrections.Todd Fiala2015-09-141-1/+2
| | | | llvm-svn: 247602
* Correct XFAIL OS list after r247576Ed Maste2015-09-141-2/+2
| | | | | | | In ConstVariableTestCase::test_with_dwarf_and_run_command - the test fails with Clang (and presumably ICC) also on FreeBSD. llvm-svn: 247594
* Fix up bad compiler spec on ConstVariableTestCase; fixup two more OS X ↵Todd Fiala2015-09-141-1/+2
| | | | | | unexpected successes. llvm-svn: 247591
* Cleaned up a few unexpected successes on OS XTodd Fiala2015-09-141-2/+1
| | | | | | | | | TestCallStdStringFunction TestCallWithTimeout TestConstVariables TestClassTypes llvm-svn: 247576
* Add missed import lldbtest.Oleksiy Vyalov2015-09-111-0/+1
| | | | llvm-svn: 247469
* XFAIL 2 breakpoint tests on Windows.Zachary Turner2015-09-111-0/+1
| | | | | | llvm.org/pr24777 llvm-svn: 247459
* XFAIL some C++ language specific tests on Windows.Zachary Turner2015-09-112-1/+2
| | | | | | http://llvm.org/pr24764 llvm-svn: 247455
* Fix a bunch of portability issues in test executables.Zachary Turner2015-08-251-0/+1
| | | | llvm-svn: 245983
* [Windows] XFAIL tests that require calling a function in target.Zachary Turner2015-08-203-0/+3
| | | | | | | This has known issues on Windows. Fixing this is tracked by http://llvm.org/pr21765 llvm-svn: 245630
* XFAIL TestAnonymous.test_expr_null_with_dwarf on Windows.Zachary Turner2015-08-201-0/+1
| | | | | | | This bug is tracked in llvm.org/pr21550, and also reproduces on FreeBSD apparently. llvm-svn: 245627
* Fix TestArrayTypes on Windows.Zachary Turner2015-08-181-3/+7
| | | | | | | | | | Whether or not frames print their tid in hex or decimal is apparently hardcoded to depend on the operating system. For now a comment was added that this should be changed to a more sane check (for example a setting), and the OS check is updated to do the right thing for Windows. llvm-svn: 245371
* Mark TestCModules as XFAIL on OSX.Oleksiy Vyalov2015-08-181-0/+2
| | | | | | http://reviews.llvm.org/D11962 llvm-svn: 245357
* [Windows] XFAIL tests that depend on expression name lookup.Zachary Turner2015-08-182-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | Name lookup doesn't work properly with Windows targets. This is most likely due to issues with name mangling, although there is at least one set of debug info related issues as well, since some of the name lookup requests appear to be failing on types rather than symbols. Specifically, this patch XFAILS the following set of tests: TestChar1632T.py TestRdar12991846.py TestConstVariables.py TestCallCPPFunction.py TestCallStopAndContinue.py TestCallUserDefinedFunction.py TestCModules.py TestCPPThis.py TestExprs2.py TestOverloadedFunctions.py TestRvalueReferences.py And fixing the underlying issue is tracked in http://llvm.org/pr24489 llvm-svn: 245338
* Don't test the output of "target modules dump symfile a.out" as this isn't ↵Greg Clayton2015-08-141-4/+0
| | | | | | something we should be testing for. This makes this test pass again. llvm-svn: 245078
* Fixed a problem where variables in modules were not appropriately discovered bySean Callanan2015-07-101-0/+3
| | | | | | | | the expression parser. <rdar://problem/21395220> llvm-svn: 241917
* Fixed the C modules test case on Darwin by streamlining its code.Sean Callanan2015-07-081-2/+0
| | | | | | | | | | We don't need to do the fancy dance with checking whether the iterator represents a #define -- in fact, that's the wrong thing to do. The thing to do is check whether the highest-priority module that did something to the module #defined or #undefd it. If it #defined it, then the MacroInfo* will be non-NULL and we're good to go. llvm-svn: 241651
* Fix typosBruce Mitchener2015-07-022-10/+10
| | | | | | | | | | | | Summary: Fixes more typos. Reviewers: clayborg Subscribers: lldb-commits-list Differential Revision: http://reviews.llvm.org/D10898 llvm-svn: 241289
* Reversed r238363, because the message is inconsistentSean Callanan2015-07-0113-15/+15
| | | | | | with all the other assertion messages. llvm-svn: 241212
* Fixed incorrect application of expectedFlakeyVince Harron2015-06-261-1/+1
| | | | llvm-svn: 240803
* Added expectedFlakey test decoratorVince Harron2015-06-261-1/+1
| | | | | | | | | | | | | | | | | SUMMARY Flakey tests get two chances to pass Also, switched a bunch of tests to use new decorator. TEST PLAN Add one of these decorators to a test Edit a test to pass on the first invocation, confirm test appears as pass Edit a test to pass on the first invocation, pass on the second, confirm test appears as xfail Edit a test to fail on two consecutive runs, confirm test appears in results as fail/error Differential Revision: http://reviews.llvm.org/D10721 llvm-svn: 240789
* TestGlobalVariables no longer fails on FreeBSDEd Maste2015-06-021-1/+0
| | | | | | | | It has passed since ~ r223393. llvm.org/21599 llvm-svn: 238856
* [TestBase.runCmd] Better error message when runCmd fails.Siva Chandra2015-05-2713-15/+15
| | | | | | | | | | | | | | | | | | | | | 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-121-0/+2
| | | | | | | | | | | | | | 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
* TestCModules was effectively skipped on LinuxVince Harron2015-05-081-3/+2
| | | | | | | | | | | | | | Summary: I've removed the secret skip and added expectedFailureLinux Test Plan: run tests Reviewers: flackr Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D9615 llvm-svn: 236914
* Restore TestRegisterVariables failure decorator for older ClangEd Maste2015-05-061-0/+1
| | | | | | | The @expectedFailureClang decorator was removed in r236447, but it seems to be fixed only with Clang 3.5+. llvm-svn: 236614
* [ValueObject] Do not return address of eValueTypeHostAddress values.Siva Chandra2015-05-041-1/+0
| | | | | | | | | | | | | | | | | | Summary: This fixes TestRegisterVariables for clang and hence it is enabled in this commit. Test Plan: dotest.py -C clang -p TestRegisterVariables Reviewers: clayborg Reviewed By: clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D9421 llvm-svn: 236447
* TestCModules - fixed for gccVince Harron2015-05-041-1/+1
| | | | | | Changed restrict keyword to something understood by gcc llvm-svn: 236410
* un-skipped a bunch of tests on LinuxVince Harron2015-05-041-1/+0
| | | | | | | | | Some have been marked as skipIfLinux for years. The seem to be passing so I've enabled them. Differential Revision: http://reviews.llvm.org/D9428 llvm-svn: 236403
* Added support to ClangUserExpression for importingSean Callanan2015-04-141-0/+3
| | | | | | | | | | | | | all the macros from the modules the user has loaded. These macros are currently imported textually into the expression's source code, which turns out not to impose the horrific string processing overhead that I thought it would, but I still plan to look into performance improvements. Also modified TestCModules to test that this works. llvm-svn: 234922
* Updated IRForTarget to change the way we generateSean Callanan2015-04-141-2/+0
| | | | | | | | | | | | relocations. We used to do GEP on a pointer to the result type, which is wrong. We should be doing GEP on a pointer to char, which allows us to offset correctly. This fixes the C modules testcase, so it's no longer ExpectFail. llvm-svn: 234918
* [TestAnonymous] Enable all tests for GCCSiva Chandra2015-04-101-8/+5
| | | | | | | | | | | | | | | | | | Summary: Also added "_with_dsym" prefix to the dsym tests, and "_with_dwarf" to the dwarf tests. Test Plan: dotest.py -C gcc -p TestAnonymous Reviewers: chaoren Reviewed By: chaoren Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D8944 llvm-svn: 234624
* [TestBitfields] Correct the attribute name to "aligned" in the testcase.Siva Chandra2015-04-092-7/+2
| | | | | | | | | | | | | | | | | | Summary: This makes all parts of the test pass with Clang and GCC. They are enabled with this patch. Test Plan: dotest.py -C <clang|gcc> -p TestBitfields Reviewers: vharron, clayborg Reviewed By: clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D8874 llvm-svn: 234523
* Made the struct types test case a little stricter,Sean Callanan2015-04-071-1/+17
| | | | | | | by verifying that we can pass a struct-typed variable to a function that takes structs. llvm-svn: 234348
* Marked the modules tests as expected failures,Sean Callanan2015-04-031-0/+2
| | | | | | | | because the OS X builders aren't happy with them. <rdar://problem/20416388> llvm-svn: 234028
OpenPOWER on IntegriCloud