summaryrefslogtreecommitdiffstats
path: root/lldb/test/lang/c/bitfields/TestBitfields.py
Commit message (Collapse)AuthorAgeFilesLines
* Move lldb/test to lldb/packages/Python/lldbsuite/test.Zachary Turner2015-10-281-162/+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
* Port the python api decorator to use test categoriesPavel Labath2015-10-261-1/+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-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-8/+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
* Merge dwarf and dsym testsTamas Berghammer2015-09-301-33/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* 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
* Reversed r238363, because the message is inconsistentSean Callanan2015-07-011-1/+1
| | | | | | with all the other assertion messages. llvm-svn: 241212
* [TestBase.runCmd] Better error message when runCmd fails.Siva Chandra2015-05-271-1/+1
| | | | | | | | | | | | | | | | | | | | | 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
* [TestBitfields] Correct the attribute name to "aligned" in the testcase.Siva Chandra2015-04-091-6/+1
| | | | | | | | | | | | | | | | | | 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
* Replace sys.platform skips in tests with @skip decorators which check ↵Robert Flack2015-03-301-4/+4
| | | | | | | | | | | | | | | | 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 error introduced by changing function signatures.Zachary Turner2015-03-241-0/+2
| | | | | | | | | | | | | | | | | Since ClangASTSource::layoutRecordType() was overriding a virtual function in the base, this was inadvertently causing a new method to be introduced rather than an override. To fix this all method signatures are changed back to taking DenseMaps, and the `override` keyword is added to make sure this type of error doesn't happen again. To keep the original fix intact, which is that fields and bases must be added in offset order, the ImportOffsetMap() function now copies the DenseMap into a vector and then sorts the vector on the value type (e.g. the offset) before iterating over the sorted vector and inserting the items. llvm-svn: 233099
* Fix record layout when synthesizing class types.Zachary Turner2015-03-241-2/+0
| | | | | | | | | | | | | | | | | Prior to this patch, we would try to synthesize class types by iterating over a DenseMap of FieldDecls and adding each one to a CXXRecordDecl. Since a DenseMap doesn't provide a deterministic ordering of the elements, this would not add the fields in FieldOffset order, but rather in some random order determined by the memory layout of the DenseMap. This patch fixes the issue by changing DenseMaps to vectors. The ability to lookup a value in the DenseMap was hardly being used, and where it is sufficient to do a vector lookup. Differential Revision: http://reviews.llvm.org/D8512 llvm-svn: 233090
* Fix a number of tests on Windows.Zachary Turner2015-01-141-0/+2
| | | | | | | These fix various issues with path handling and disable a few tests which use features of LLVM which are not yet supported on Windows. llvm-svn: 226042
* Work around clang's ignoring __attribute ( align(16) ) in this test case.Jim Ingham2014-03-191-1/+6
| | | | llvm-svn: 204207
* Correctly set the working directory when launching processes for both local ↵Greg Clayton2013-12-131-1/+1
| | | | | | and remote targets. llvm-svn: 197266
* 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
* Adds a test for 'target module dump symfile' to the LLDB suite.Ashok Thirumurthi2013-07-311-0/+4
| | | | | TODO: Improve coverage of SBTypeMember and of 'target module dump'. llvm-svn: 187519
* Fix invalid TestBitfields case (thanks Filipe!), and xfail one case due to ↵Daniel Malea2013-02-201-2/+1
| | | | | | | | | | | | | | | GCC compiler bug. Turns out unnamed bit fields should not be accessed ever in C (C99 section 4.7.8) or C++ (C++11 section 9.6). Unrelated to the above, this commit marks TestBitfields as expected-to-fail with GCC as 4.7 has problems with padding... the size of the struct with a uint32_t member is reported as 12 when GCC is used. Clang emits correct code. Parts of this patch prepared by Filipe Cabecinhas! llvm-svn: 175666
* More test case cleanup (Linux and Mac):Daniel Malea2013-02-151-1/+0
| | | | | | | | - remove expectedFailure decorator from resolved rdar 12566646 and 10887661 - remove expectedFailure from TestBitfields testcase not actually affected by bug - skip the (non-deterministic) TestStopHookMechanism.py to avoid a noisy suite on Linux llvm-svn: 175307
* Marking two tests expected-to-fail on LinuxDaniel Malea2013-02-141-0/+2
| | | | | | | - PR-15260: lldb does not display correct value of 1-bit field - PR-16261: lldb does not display size of (file/class) static array llvm-svn: 175111
* Rewrote the bitfield logic. Major changes include:Sean Callanan2012-12-051-0/+33
| | | | | | | | | | | | | | | | - Removed the BitfieldMap class because it is unnecessary. We now just track the most recently added field. - Moved the code that calculates bitfield widths so it can also be used to determine whether it's necessary to insert anonymous fields. - Simplified the anonymous field calculation code into three cases (two of which are resolved identically). - Beefed up the bitfield testcase. llvm-svn: 169449
* <rdar://problem/12798131> Greg Clayton2012-12-041-2/+2
| | | | | | | | | | | | 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
* Added unnamed bitfields to our bitfield test.Greg Clayton2012-11-061-7/+6
| | | | llvm-svn: 167473
* Fix all the test case breakages caused by folks writing tests all over the ↵Jim Ingham2012-09-221-4/+2
| | | | | | | | place that depended explicitly on the output of "break set". Please don't do this sort of thing!!!!! llvm-svn: 164433
* Second batch of adding @dsym_test/@dwarf_test decorators to existing test cases.Johnny Chen2012-04-061-0/+4
| | | | | | | Plus some minor cleanup of test method names. Third and final batch is coming. llvm-svn: 154197
* I have brought LLDB up-to-date with top of treeSean Callanan2012-02-041-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | LLVM/Clang. This brings in several fixes, including: - Improvements in the Just-In-Time compiler's allocation of memory: the JIT now allocates memory in chunks of sections, improving its ability to generate relocations. I have revamped the RecordingMemoryManager to reflect these changes, as well as to get the memory allocation and data copying out fo the ClangExpressionParser code. Jim Grosbach wrote the updates to the JIT on the LLVM side. - A new ExternalASTSource interface to allow LLDB to report accurate structure layout information to Clang. Previously we could only report the sizes of fields, not their offsets. This meant that if data structures included field alignment directives, we could not communicate the necessary alignment to Clang and accesses to the data would fail. Now we can (and I have update the relevant test case). Thanks to Doug Gregor for implementing the Clang side of this fix. - The way Objective-C interfaces are completed by Clang has been made consistent with RecordDecls; with help from Doug Gregor and Greg Clayton I have ensured that this still works. - I have eliminated all local LLVM and Clang patches, committing the ones that are still relevant to LLVM and Clang as needed. I have tested the changes extensively locally, but please let me know if they cause any trouble for you. llvm-svn: 149775
* Cleaned up the SBType.h file to not include internal headers and reorganizedGreg Clayton2011-08-031-7/+7
| | | | | | | | | | | | | | | | | | 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
* The lldbtest.TestBase.DebugSBValue(self, val) method call now does not need ↵Johnny Chen2011-07-111-4/+4
| | | | | | | | the frame argument. Only the val (of SBValue type) argument is needed. llvm-svn: 134915
* Move some directories to now reside under lang/c or lang/cpp.Johnny Chen2011-06-251-0/+155
llvm-svn: 133881
OpenPOWER on IntegriCloud