summaryrefslogtreecommitdiffstats
path: root/lldb/test/help/TestHelp.py
Commit message (Collapse)AuthorAgeFilesLines
* Move lldb/test to lldb/packages/Python/lldbsuite/test.Zachary Turner2015-10-281-165/+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
* 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-1/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Fix help test cases after r226068Ed Maste2015-01-201-5/+5
| | | | | | | From: Ilia K <ki.stfu@gmail.com> Differential Revision: http://reviews.llvm.org/D7066 llvm-svn: 226568
* 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
* Re-apply TestHelp.py fixDaniel Malea2013-07-031-1/+1
| | | | llvm-svn: 185570
* Revert commits that cause broken builds on GCC buildbotsDaniel Malea2013-07-031-1/+1
| | | | | | | | - build fails due to PyCallable template definition inside an extern "C" scope This commit reverts 185240, 184893 and 184608. llvm-svn: 185560
* Lots of cleanup on the SWIG wrapping layerEnrico Granata2013-06-211-1/+1
| | | | | | | | | | Now, the way SWIG wrappers call into Python is through a utility PyCallable object, which overloads operator () to look like a normal function call Plus, using the SBTypeToSWIGWrapper() family of functions, we can call python functions transparently as if they were plain C functions Using this new technique should make adding new Python call points easier and quicker The PyCallable is a generally useful facility, and we might want to consider moving it to a separate layer where other parts of LLDB can use it llvm-svn: 184608
* Fixed the version test for darwin.Greg Clayton2013-04-031-1/+1
| | | | llvm-svn: 178595
* Remove LLDB dependency on xcodeworkspace (on Linux) for version numberDaniel Malea2013-02-281-1/+6
| | | | | | | | | | | | | | | | | | | | - make LLDB version number match Clang (and the Debian package) - use the same revision detection magic that Clang uses to report SVN/Git revisions - update test case as per above Example output: $ lldb -v lldb version 3.3 (https://dmalea@llvm.org/svn/llvm-project/lldb/trunk revision 176211 clang revision 176208 llvm revision 176208) ss This line, and those below, will be ignored-- M source/lldb.cpp M test/help/TestHelp.py M source/Makefile llvm-svn: 176268
* Reimplemented the code that backed the "settings" in lldb. There were many ↵Greg Clayton2012-08-221-1/+4
| | | | | | | | | | | | | issues with the previous implementation: - no setting auto completion - very manual and error prone way of getting/setting variables - tons of code duplication - useless instance names for processes, threads Now settings can easily be defined like option values. The new settings makes use of the "OptionValue" classes so we can re-use the option value code that we use to set settings in command options. No more instances, just "does the right thing". llvm-svn: 162366
* rdar://problem/11535045Johnny Chen2012-05-261-0/+5
| | | | | | | | Make 'help arch' return the list of supported architectures. Add a convenience method StringList::Join(const char *separator) which is called from the help function for 'arch'. Also add a simple test case. llvm-svn: 157507
* Fix the problem that 'help breakpoint set' is printing a lot of redundant lines.Johnny Chen2012-05-071-0/+6
| | | | | | | | | | Correctly specify the LLDB_OPT_SET's that the 'shlib' command option belongs to by using a newly added macro like this: #define LLDB_OPT_NOT_10 ( LLDB_OPT_SET_FROM(1, 10) & ~LLDB_OPT_SET_10 ) rdar://problem/11393864 llvm-svn: 156337
* After discussions with Jim and Greg, modify the 'watchpoint set' command to ↵Johnny Chen2012-02-081-4/+5
| | | | | | | | | | | | | | | | become a mutiword command with subcommand 'expression' and 'variable'. The first subcommand is for supplying an expression to be evaluated into an address to watch for, while the second is for watching a variable. 'watchpoint set expression' is a raw command, which means that you need to use the "--" option terminator to end the '-w' or '-x' option processing and to start typing your expression. Also update several test cases to comply and add a couple of test cases into TestCompletion.py, in particular, test that 'watchpoint set ex' completes to 'watchpoint set expression ' and that 'watchpoint set var' completes to 'watchpoint set variable '. llvm-svn: 150109
* Refine the 'watchpoint set' command to now require either the '-v' option ↵Johnny Chen2012-02-081-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (for watching of a variable) or the '-e' option (for watching of an address) to be present. Update some existing test cases with the required option and add some more test cases. Since the '-v' option takes <variable-name> and the '-e' option takes <expr> as the command arg, the existing infrastructure for generating the option usage can produce confusing help message, like: watchpoint set -e [-w <watch-type>] [-x <byte-size>] <variable-name | expr> watchpoint set -v [-w <watch-type>] [-x <byte-size>] <variable-name | expr> The solution adopted is to provide an extra member field to the struct CommandArgumentData called (uint32_t)arg_opt_set_association, whose purpose is to link this particular argument data with some option set(s). Also modify the signature of CommandObject::GetFormattedCommandArguments() to: GetFormattedCommandArguments (Stream &str, uint32_t opt_set_mask = LLDB_OPT_SET_ALL) it now takes an additional opt_set_mask which can be used to generate a filtered formatted command args for help message. Options::GenerateOptionUsage() impl is modified to call the GetFormattedCommandArguments() appropriately. So that the help message now looks like: watchpoint set -e [-w <watch-type>] [-x <byte-size>] <expr> watchpoint set -v [-w <watch-type>] [-x <byte-size>] <variable-name> rdar://problem/10703256 llvm-svn: 150032
* Add a simple test case for 'help watchpoint', 'help watchpt-id', and 'help ↵Johnny Chen2011-09-231-0/+9
| | | | | | watchpt-id-list'. llvm-svn: 140393
* Adding two new options to the 'help' command:Enrico Granata2011-09-091-0/+12
| | | | | | | | | | | --show-aliases (-a) shows aliases for commands, as well as built-in commands --hide-user-defined (-u) hides user defined commands by default 'help' without arguments does not show aliases anymore. to see them, add --show-aliases to have only built-in commands appear, use 'help --hide-user-defined' ; there is currently no way to hide built-in commands from the help output 'help command' is not changed by this commit, and help is shown even if command is an alias and -a is not specified llvm-svn: 139377
* Update the test case in light of recent change of LLDB-Info.plist to track ↵Johnny Chen2011-08-261-1/+3
| | | | | | | | Apple Generic Version number from the Xcode project file. llvm-svn: 138677
* Fix the 'target variable' help syntax to output one or more <variable-name>'s.Johnny Chen2011-08-221-0/+5
| | | | | | Add a simple test case for that. llvm-svn: 138281
* Fixed a crasher where entering 'help disasm' on the command line would crash ↵Johnny Chen2011-07-141-0/+5
| | | | | | | | | | | lldb. The reasom of the crash is because of a missing entry in the argument table corresponding to eArgTypeUnsignedInteger. Add such entry and modify the call site of the crash to go through a fail-fast API to retrieve the argument table. Add a regression test to TestHelp.py. llvm-svn: 135206
* Modify TestHelp to search for LLDB-Info.plist in the correct placePeter Collingbourne2011-06-201-1/+1
| | | | | | | This is required to run the test suite outside of the source tree or on a case sensitive file system. llvm-svn: 133460
* Add comments about 'image' being an alias for 'target modules'.Johnny Chen2011-05-031-0/+2
| | | | llvm-svn: 130806
* Update the golden output strings to match against after the recent change.Johnny Chen2011-05-031-2/+2
| | | | llvm-svn: 130804
* Print out a more meaningful exception message when/if CFBundleVersion ↵Johnny Chen2011-01-071-1/+2
| | | | | | matching failed. llvm-svn: 122985
* Modify test_help_version() test case to be more precise in matching the versionJohnny Chen2011-01-061-1/+36
| | | | | | number string as found in the resources/LLDB-info.plist file. llvm-svn: 122930
* Add a simple command: 'version' to the command interpreter, and an accompanyingJohnny Chen2010-12-231-0/+7
| | | | | | test case test_help_version(). llvm-svn: 122515
* Add test cases to test that:Johnny Chen2010-12-011-0/+13
| | | | | | | 1. 'help image du sym' is ambiguous. 2. 'help image du line' is not ambiguous. llvm-svn: 120587
* Remove the @expectedFailure decorator as the bug has been fixed.Johnny Chen2010-12-011-2/+0
| | | | llvm-svn: 120515
* Add expectedFailure decorator for ↵Johnny Chen2010-11-301-0/+2
| | | | | | | | test_help_image_dump_symtab_should_not_crash(). Possibly due to http://llvm.org/viewvc/llvm-project?rev=120484&view=rev. llvm-svn: 120503
* o TestStdCXXDisassembly.py:Johnny Chen2010-10-081-1/+7
| | | | | | | | | | | | | | | | | | | | Update the expected match string. o lldbtest.py: Indicate when a command fails, even if there is nothing in the error stream. o TestHelp.py: Add a regression test case for 'help image dump symtab'. o CommandObjectHelp.cpp: Some of the logic branches with successful help command results were not tagged with a Success Status. They are fixed now. This is important for Python interaction. llvm-svn: 116062
* LLDB command "set term-width 0" needs to be changed to "settings set ↵Johnny Chen2010-09-071-2/+2
| | | | | | | | term-width 0" after the recent checkin. llvm-svn: 113206
* Changed the test case class names to be noun-like instead of verb-like.Johnny Chen2010-09-011-1/+1
| | | | llvm-svn: 112732
* Changed TestBase.expect() to allow default 'msg' arg. Converted TestHelp.py.Johnny Chen2010-08-201-14/+5
| | | | llvm-svn: 111671
* Added more informational assert message strings.Johnny Chen2010-08-191-6/+6
| | | | llvm-svn: 111536
* Factored the "continue" command execution of the inferior process as part of theJohnny Chen2010-08-161-3/+0
| | | | | | | | | cleanup before finish into the test fixture in lldbtest.TestBase.tearDown(). Derivatives of TestBase is responsible for setting self.runStarted to True if an inferior process has been started. llvm-svn: 111188
* Modified the remaining test cases to display more meaningful assert messages.Johnny Chen2010-08-091-8/+10
| | | | | | Added a generic message generator to the lldbtest.py base module. llvm-svn: 110625
* o Added unittest2 which has added the new features in unittest for Python 2.7Johnny Chen2010-08-051-2/+2
| | | | | | | | | | | | | | backported to Python 2.3+. Some of the features desired include better verbose reporting in unittest2.TextTestRunner and decorator support for skipping tests and expected failures. http://pypi.python.org/pypi/unittest2 o Modified the existing .py tests to use unittest2 and decorated TestSTL.test_step_into_stl(), which is known to always fail currently, with @unittest2.expectedFailure. llvm-svn: 110397
* When running a single test case, lldb.SBDebugger.Terminate() is not being calledJohnny Chen2010-08-051-1/+2
| | | | | | | because unittest.main() calls sys.exit() before returning. Fixed by registering an exit handler for this situation. llvm-svn: 110379
* Added comment.Johnny Chen2010-08-021-1/+5
| | | | llvm-svn: 110066
* Abstracted the lldb-specific unittest.TestCase.setUp()/tearDown() in a separateJohnny Chen2010-07-031-25/+4
| | | | | | | | | | | module lldbtest.py and refactored the existing test cases to derive from the abstract base class lldbtest.TestBase. MOdified the test driver (dotest.py and dotest.pl) to set up additional PYTHONPATH component for locating the lldbtest module, which sits in the same directory. llvm-svn: 107563
* Turn on logging for debugging purposes if ${LLDB_LOG} environment variable isJohnny Chen2010-07-011-1/+7
| | | | | | | | | is defined. Use ${LLDB_LOG} to specify the log file. Create a singleton SBDebugger in the lldb namespace, that gets used when running the entire test suite. llvm-svn: 107445
* Added some delay (100 ms) after executing each 'command interpreter' command;Johnny Chen2010-07-011-1/+6
| | | | | | | this seems to alleviate the intermittent failure observed while running the whole test suite. llvm-svn: 107357
* Add some delay before calling SBDebugger.Terminate().Johnny Chen2010-06-291-1/+1
| | | | llvm-svn: 107221
* Added TestArrayTypes.py for test/array_types directory.Johnny Chen2010-06-291-6/+11
| | | | | | | Also modified dotest.py so that it sets the LLDB_TEST environment variable so that individual test cases can locate their supporting files correctly. llvm-svn: 107220
* For the time being, let's bracket the test runner within theJohnny Chen2010-06-291-1/+3
| | | | | | | | lldb.SBDebugger.Initialize()/Terminate() pair. Change TestHelp.py to use synchronous debugging, which is easier to work with. llvm-svn: 107198
* Added test for a previously fixed bug where invoking lldb command from an emacsJohnny Chen2010-06-281-1/+12
| | | | | | shell and issuing 'help' would hang (was actually infinitely looping). llvm-svn: 107066
* A simple test of 'help' command and its output.Johnny Chen2010-06-251-0/+29
llvm-svn: 106909
OpenPOWER on IntegriCloud