summaryrefslogtreecommitdiffstats
path: root/lldb/test/lldbtest.py
Commit message (Collapse)AuthorAgeFilesLines
...
* Add a HideStdout() method to our TestBase class and call it from ↵Johnny Chen2011-04-211-0/+30
| | | | | | | | | | | | TestAbbreviations.py and TestAliases.py. Pass the keyword argument 'check=False' to: self.runCmd("script my.date()", check=False) since we want to restore sys.stdout no matter what the outcome of the runCmd is. llvm-svn: 129949
* Modify docstring.Johnny Chen2011-04-191-1/+1
| | | | llvm-svn: 129786
* Add a TraceOn(self) method to the base test class, which returns True if we areJohnny Chen2011-04-191-0/+4
| | | | | | | | currently in trace mode (-t to dotest.py), i.e., tracing the lldb command execution. Change TestInferiorCrashing.inferior_crashing_python(self) to check this flag in order to print the stack trace of the inferior thread. llvm-svn: 129785
* Add a test script for exercising the "taregt create", "target list", and ↵Johnny Chen2011-04-181-1/+17
| | | | | | "target select" commands. llvm-svn: 129717
* Forgot to check in this change with ↵Johnny Chen2011-04-151-1/+3
| | | | | | http://llvm.org/viewvc/llvm-project?view=rev&revision=129542. llvm-svn: 129574
* Turns out that the test failure wrt:Johnny Chen2011-03-231-2/+3
| | | | | | | | | | | | | | | | | | | | | | | rdar://problem/9173060 lldb hangs while running unique-types disappears if running with clang version >= 3. Modify the TestUniqueTypes.py to detect if we are running with clang version < 3 and, if true, skip the test. Update the lldbtest.system() function to return a tuple of (stdoutdata, stderrdata) since we need the stderr data from "clang -v" command. Modify existing clients of lldbtest.system() to now use, for example: # First, capture the golden output emitted by the oracle, i.e., the # series of printf statements. - go = system("./a.out", sender=self) + go = system("./a.out", sender=self)[0] # This golden list contains a list of (variable, value) pairs extracted # from the golden output. gl = [] And add two utility functions to lldbutil.py. llvm-svn: 128162
* Add a test directory stop-hook to test the newly added "target stop-hook" ↵Johnny Chen2011-03-121-0/+16
| | | | | | | | | | | | | command. This uses pexpect module to spawn a 'lldb' program and uses pseudo-TTY to talk to the child application. The test cases test setting breakpoints, adding a stop-hook with line range, and verifies that when the inferior stops, the stop-hook will fire off when it is within range and will not fire off when it is out of range. llvm-svn: 127519
* Discover the 'lldb' executable in the setUp() hook of the base test class.Johnny Chen2011-03-111-0/+3
| | | | llvm-svn: 127481
* Some cleanup to plugins/darwin.py after the recent additions of '-A arch' ↵Johnny Chen2011-01-271-5/+16
| | | | | | | | and '-C compiler' command line options to the test driver. Replace TestBase.getRunSpec() with TestBase.getRunOptions(). llvm-svn: 124353
* Deprecated old forms of SBTarget::Launch. There is not just one and noGreg Clayton2011-01-231-1/+1
| | | | | | SWIG renaming done to work around deprecated APIs. llvm-svn: 124075
* Fix a typo in the comment.Johnny Chen2011-01-191-1/+1
| | | | llvm-svn: 123840
* The test suite was unnecessarily doing a time.sleep() after performing theJohnny Chen2011-01-191-4/+2
| | | | | | | | "process launch" or "run" interpreter command. Let's do the sleep only if the process launch failed. This saves about 135 seconds from the whole test suite run time. llvm-svn: 123806
* Add a test case for the SBFrame APIs. In particular, it uses the frame API toJohnny Chen2010-12-231-2/+4
| | | | | | | | | get the argument values of the call stacks when stopped on the breakpoint. Radar has been filed for the expected failures: test failure: ./dotest.py -v -w -t -p TestFrames (argument values are wrong) llvm-svn: 122460
* Execute the test case teardown hooks in a LIFO (last in, first out) order.Johnny Chen2010-12-141-1/+1
| | | | | | | ALso add a teardown hook to the LoadUnloadTestCase.test_dyld_library_path() test case to have it restore the DYLD_LIBRARY_PATH environment variable. llvm-svn: 121802
* Add TestBreakpointIgnoreCount.py to exercise the breakpoint ignore count ↵Johnny Chen2010-12-131-0/+2
| | | | | | | | features, with both command line and Python API tests. llvm-svn: 121717
* Make sure that @python_api_test is only used to decorate a test method, not theJohnny Chen2010-12-101-0/+2
| | | | | | test class. llvm-svn: 121538
* Add a '+a' command line option to the test driver to run only the Python API ↵Johnny Chen2010-12-101-0/+12
| | | | | | | | | tests. Add an attribute __python_api_test__ (set to True) to the @python_api_test decorated test method to distinguish them from the lldb command line tests. llvm-svn: 121500
* Add an infrastructure to mark the Python APIs only test using a decorator.Johnny Chen2010-12-101-0/+10
| | | | | | | | | | | | | | | | | | Example: @python_api_test def test_evaluate_expression_python(self): """Test SBFrame.EvaluateExpression() API for evaluating an expression.""" ... The opposite of Python APIs only test is an lldb command line test, which sends commands to the lldb command interpreter. Add a '-a' option to the test driver to skip Python API only tests. Modify TestExprs.py to mark a test as @python_api_test and remove an @expectedFailure decorator as the bug has been fixed. llvm-svn: 121442
* Add a test/source-manager directory for testing lldb core component ↵Johnny Chen2010-12-091-0/+2
| | | | | | | | | SourceManager. Initial test case test_modify_source_file_while_debugging() in TestSourceManager.py tests the caching mechanism of the source manager. llvm-svn: 121389
* For SBTarget.Launch()/LaunchProcess(), there's no need to pass an empty stringJohnny Chen2010-12-081-0/+4
| | | | | | | | | | | | | | as the args and the envs to the launched process. o lldbtest.py: Forgot to check in some assertion messages changes for lldbtest.py. o dotest.py: Also add "api" category to the default lldb log option list. llvm-svn: 121220
* Fail fast by raising an exception if the 'string_to_match' cannot be locatedJohnny Chen2010-12-061-1/+1
| | | | | | within the file 'filename'. llvm-svn: 121039
* Forgot to also check in this file along with the TestBreakpointConditions.py ↵Johnny Chen2010-12-041-0/+2
| | | | | | change. llvm-svn: 120861
* Add a mechanism of overwriting the default 1.0 second wait time between testJohnny Chen2010-12-011-1/+4
| | | | | | | cases when specifying '-w' to the test driver, by using an environment variable LLDB_TIME_WAIT_BETWEEN_TEST_CASES. llvm-svn: 120625
* TestBase.setUp() needs to make sure lldb.blacklist is not NoneJohnny Chen2010-12-011-6/+7
| | | | | | before iterating on it. llvm-svn: 120623
* Add a '-b blacklistFile' option to the test driver to take a file specifying theJohnny Chen2010-12-011-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | test classes or test cases to be excludued from the test suite. Check in an example blacklist file: blacklist.py: """ 'blacklist' is a Python dictionary, it stores the mapping of a string describing either a testclass or a testcase, i.e, testclass.testmethod, to the reason (a string) it is blacklisted. Following is an example which states that test class IntegerTypesExprTestCase should be skipped because 'This test class crashed' and the test case FoundationTestCase.test_data_type_and_expr_with_dsym should be skipped because it is 'Temporarily disabled'. blacklist = {'IntegerTypesExprTestCase': 'This test class crashed', 'FoundationTestCase.test_data_type_and_expr_with_dsym': 'Temporarily disabled' } """ blacklist = {} An example of invoking the test driver and specifying a blacklist file: ./dotest.py -b blacklist.py -v types This runs the tests under 'types' directory but excludes the tests specified in balcklist.py. llvm-svn: 120620
* Add an expect() statement within breakpoint_conditions() method which tests thatJohnny Chen2010-11-291-0/+2
| | | | | | | | | | | | | | | the process status is indeed 'stopped' before invoking 'frame variable -t val' command to inspect the frame variable. When I run the test suite, it sometimes emits an output like: runCmd: frame variable -t val runCmd failed! error: you must be stopped in a valid stack frame to view frame variables. The expect() statement inserted is to make sure that the process is stopped and we have a valid frame. llvm-svn: 120318
* Change the variable TestBase.timeWait to the more descriptive ↵Johnny Chen2010-11-291-4/+4
| | | | | | | | | | timeWaitNextLaunch. Increase the delta between successive test cases, enabled with the '-w' option to the test driver, from 0.5 to 1.0 second, to arrive at a cleaner state before the next test case. llvm-svn: 120315
* Make the string matching for 'frame variable' more stringent with respect toJohnny Chen2010-11-171-1/+6
| | | | | | | | | | | output from clang and llvm-gcc compiled program; both generate the correct debug info with respect to the typedef scoped inside a namespace. Add a TestBase.getCompiler(self) method which returns the compiler in effect the test suite is now running with. Subclasses (like TestNamespace) can use it to distinguish among different compilers. llvm-svn: 119445
* The session log entry containing the command to rerun the same test now also ↵Johnny Chen2010-11-111-2/+9
| | | | | | | | includes the architecture and compiler specs. llvm-svn: 118860
* Some rewordings of the assert messages for process stopped due to breakpoint.Johnny Chen2010-11-101-2/+3
| | | | llvm-svn: 118739
* Add the actual stop reason to an assert message for bitfields_variable_python()Johnny Chen2010-11-101-1/+3
| | | | | | | | test method when asserting: thread.GetStopReason() == lldb.eStopReasonBreakpoint llvm-svn: 118711
* When dumping the session log for a failed/errored test, also emit the command toJohnny Chen2010-11-091-0/+3
| | | | | | | | | | | | | | | | | | invoke the test driver to rerun the very same test. Example output: /Volumes/data/lldb/svn/trunk/test $ tail 2010-11-09-14_51_34/ExpectedFailure-TestSettings.SettingsCommandTestCase.test_set_output_path.log Traceback (most recent call last): File "/Volumes/data/lldb/svn/trunk/test/settings/TestSettings.py", line 136, in test_set_output_path "'stdout.txt' exists due to target.process.output-path.") AssertionError: False is not True : 'stdout.txt' exists due to target.process.output-path. To rerun this test, issue the following command from the 'test' directory: ./dotest.py -v -t -f SettingsCommandTestCase.test_set_output_path llvm-svn: 118646
* Distinguish between the assert messages for runCmd and expect. The former nowJohnny Chen2010-11-091-7/+11
| | | | | | | | | | | | | | takes the form: "Command '%s' returns successfully" % str and the latter takes the form: "'%s' returns expected result" % str or "'%s' matches expected result" % str llvm-svn: 118599
* Make the type of session log part of the filename itself. It allows for easierJohnny Chen2010-11-061-1/+4
| | | | | | | | | identification of the test failures/errors by human beings as well as automatic processings. The prefix which identifies the type can be: Error, Failure, or ExpectedFailure. llvm-svn: 118315
* Fix comments.Johnny Chen2010-11-051-3/+3
| | | | llvm-svn: 118285
* Add a test for Python API SBValue.GetValueType() inside TestArrayTypes.py for aJohnny Chen2010-11-031-0/+3
| | | | | | | | | | | local variable and an argument variable. Add ValueTypeString() utility function into lldbutil.py which converts the enum into a human readable string. Modify TestBase.DebugSBValue() to also dump the value type of an SBValue object. llvm-svn: 118197
* Now that the test suite has very few expected failures remaining (2), it is ↵Johnny Chen2010-11-031-11/+33
| | | | | | | | | | | | | a good idea to also dump the session information for expected failures in addition to failures and errors (tests with unexpected exceptions). Modify the LLDBTestResult class which derives from unittest2.TextTestResult to intercept the addExpectedFailure() method in order to mark the test instance as needing its session information dumped. llvm-svn: 118185
* Add more comment for dumpSessionInfo(self) method.Johnny Chen2010-11-031-0/+7
| | | | llvm-svn: 118129
* Replace the two call sites of inspect.getsource(obj) with a utility functionJohnny Chen2010-11-011-4/+13
| | | | | | getsource_if_available(obj) which also handles the exception if it occurs. llvm-svn: 117949
* Python API changes: SBValue.IsPtrType() -> SBValue.IsPointerType().Johnny Chen2010-11-011-7/+7
| | | | | | SBFrame print representation: idx: 0 -> #0 llvm-svn: 117924
* Add comment on passing the assert message to self.runCmd().Johnny Chen2010-10-281-0/+1
| | | | llvm-svn: 117604
* If TestBase.expect() is passed an assert message, pass it along when ↵Johnny Chen2010-10-281-1/+1
| | | | | | | | | | | | | | delegating to TestBase.runCmd() to execute the debugger command. This will result in a more semantic assert message than just the command failed message like before: AssertionError: False is not True : Command 'thread list' returns successfully And now, we will have: AssertionError: False is not True : Process state is stopped due to breakpoint llvm-svn: 117569
* Add more docstring for the lldbtest.TestBase class.Johnny Chen2010-10-221-1/+54
| | | | llvm-svn: 117175
* Add test case for using SBBreakpointLocation to set break condition.Johnny Chen2010-10-221-0/+2
| | | | llvm-svn: 117116
* Add an option '-s session-dir-name' to overwrite the default timestamp-namedJohnny Chen2010-10-211-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | directory used to dump the session info for test failures/errors. Example: /Volumes/data/lldb/svn/trunk/test $ ./dotest.py -s jason -v array_types Session info for test errors or failures will go into directory jason ---------------------------------------------------------------------- Collected 4 tests test_with_dsym_and_python_api (TestArrayTypes.ArrayTypesTestCase) Use Python APIs to inspect variables with array types. ... ok test_with_dsym_and_run_command (TestArrayTypes.ArrayTypesTestCase) Test 'frame variable var_name' on some variables with array types. ... ok test_with_dwarf_and_python_api (TestArrayTypes.ArrayTypesTestCase) Use Python APIs to inspect variables with array types. ... ok test_with_dwarf_and_run_command (TestArrayTypes.ArrayTypesTestCase) Test 'frame variable var_name' on some variables with array types. ... FAIL ====================================================================== FAIL: test_with_dwarf_and_run_command (TestArrayTypes.ArrayTypesTestCase) Test 'frame variable var_name' on some variables with array types. ---------------------------------------------------------------------- Traceback (most recent call last): File "/Volumes/data/lldb/svn/trunk/test/array_types/TestArrayTypes.py", line 27, in test_with_dwarf_and_run_command self.array_types() File "/Volumes/data/lldb/svn/trunk/test/array_types/TestArrayTypes.py", line 62, in array_types 'stop reason = breakpoint']) File "/Volumes/data/lldb/svn/trunk/test/lldbtest.py", line 594, in expect self.runCmd(str, trace = (True if trace else False), check = not error) File "/Volumes/data/lldb/svn/trunk/test/lldbtest.py", line 564, in runCmd msg if msg else CMD_MSG(cmd, True)) AssertionError: False is not True : Command 'thread list' returns successfully ---------------------------------------------------------------------- Ran 4 tests in 3.086s FAILED (failures=1) /Volumes/data/lldb/svn/trunk/test $ ls jason TestArrayTypes.ArrayTypesTestCase.test_with_dwarf_and_run_command.log /Volumes/data/lldb/svn/trunk/test $ head -10 jason/TestArrayTypes.ArrayTypesTestCase.test_with_dwarf_and_run_command.log Session info generated @ Thu Oct 21 09:54:15 2010 os command: [['/bin/sh', '-c', 'make clean; make MAKE_DSYM=NO']] stdout: rm -rf "a.out" "a.out.dSYM" main.o main.d cc -arch x86_64 -gdwarf-2 -O0 -c -o main.o main.c cc -arch x86_64 -gdwarf-2 -O0 main.o -o "a.out" stderr: None retcode: 0 /Volumes/data/lldb/svn/trunk/test $ llvm-svn: 117028
* Make the breakpoint condition test more robust with regard to checking the ↵Johnny Chen2010-10-201-0/+2
| | | | | | | | | | correct parent call frame information. And comment out the check for stop reason for the time being. The stop reason disappeared from the "thread backtrace" output for breakpoint stop with condition. llvm-svn: 116939
* Clean up the teardown logic to make it more robust and to record the ↵Johnny Chen2010-10-201-4/+8
| | | | | | | | | | additions and invocations of them into session object. Remove a debug statement. llvm-svn: 116938
* Restoring the original setting should be done more robustly by adding a hook ↵Johnny Chen2010-10-191-0/+20
| | | | | | | | | | | | function to be run during tearDown() to effect the restore action instead of executing it inline during the test method, because the test may already fail and bailout before the inline restore action. Fix test_set_output_path() and pass_run_args_and_env_vars() to use this mechanism. llvm-svn: 116881
* Add Python doc string for setTearDownCleanup() method.Johnny Chen2010-10-191-4/+5
| | | | llvm-svn: 116874
* Add a little helper function SETTING_MSG(setting) to be used from ↵Johnny Chen2010-10-191-0/+6
| | | | | | TestSettings.test_set_output_path(). llvm-svn: 116847
OpenPOWER on IntegriCloud