Johnny Chen | 6be30df | 2010-08-03 22:12:11 +0000 | [diff] [blame^] | 1 | This README file describes the files and directories related to the Python test |
| 2 | suite under the current 'test' directory. |
| 3 | |
| 4 | o dotest.py |
| 5 | |
| 6 | Provides the test driver for the test suite. To invoke it, cd to the 'test' |
| 7 | directory and issue the './dotest.py' command or './dotest.py -v' for more |
| 8 | verbose output. '.dotest.py -h' prints out the help messge. |
| 9 | |
| 10 | A specific naming pattern is followed by the .py script under the 'test' |
| 11 | directory in order to be recognized by 'dotest.py' test driver as a module |
| 12 | which implements a test case, namely, Test*.py. |
| 13 | |
| 14 | o lldbtest.py |
| 15 | |
| 16 | Provides an abstract base class of lldb test case named 'TestVase', which in |
| 17 | turn inherits from Python's unittest.TestCase. The concrete subclass can |
| 18 | override lldbtest.TestBase in order to inherit the common behavior for |
| 19 | unittest.TestCase.setUp/tearDown implemented in this file. |
| 20 | |
| 21 | To provide a test case, the concrete subclass provides methods whose names |
| 22 | start with the letters test. For more details about the Python's unittest |
| 23 | framework, go to http://docs.python.org/library/unittest.html. |
| 24 | |
| 25 | ./command_source/TestCommandSource.py provides a simple example of test case |
| 26 | which overrides lldbtest.TestBase to exercise the lldb's 'command source' |
| 27 | command. The subclass should override the attribute 'mydir' in order for the |
| 28 | runtime to locate the individual test cases when running as part of a large |
| 29 | test suite or when running each test case as a separate Python invocation. |
| 30 | |
| 31 | The doc string provides more details about the setup required for running a |
| 32 | test case on its own. To run the whole test suite, 'dotest.py' is all you |
| 33 | need to do. |
| 34 | |
| 35 | o subdirectories of 'test' |
| 36 | |
| 37 | Most of them predate the introduction of the python test suite and contain |
| 38 | example C/C++/ObjC source files which get compiled into executables which are |
| 39 | to be exercised by the debugger. |
| 40 | |
| 41 | For such subdirectory which has an associated Test*.py file, it was added as |
| 42 | part of the Python-based test suite to test lldb functionality. |
| 43 | |
| 44 | Some of the subdirectories, for example, the 'help' subdirectory, do not have |
| 45 | C/C++/ObjC source files; they were created to house the Python test case which |
| 46 | does not involve lldb reading in an executable file at all. |
| 47 | |
| 48 | o dotest.pl |
| 49 | |
| 50 | In case you wonder, there is also a 'dotest.pl' perl script file. It was |
| 51 | created to visit each Python test case under the specified directory and |
| 52 | invoke Python's builtin unittest.main() on each test case. |
| 53 | |
| 54 | It does not take advantage of the test runner and test suite functionality |
| 55 | provided by Python's unitest framework. Its existence is because we want a |
| 56 | different way of running the whole test suite. As lldb and the Python test |
| 57 | suite become more reliable, we don't expect to be using 'dotest.pl' anymore. |
| 58 | |