Home | Trees | Indices | Help |
---|
|
object --+ | extension.Extension --+ | runnable.Runnable --+ | Test
A 'Test' is run to check for correct behavior.
A 'Test' performs some check on the system being tested, and indicates whether the check was successful, or whether the check failed.
Each test class (i.e., class derived from 'Test') describes a set of "arguments". Each argument has a name and a type. The values of these arguments determine the design-time parameters for the test. For example, for a test class that executes program and checks their exit codes, the arguments might consist of the name of the program to execute, and the command-line arguments that should be given to that program. QMTest uses the arguments to prompt the user when creating a new test.
Each test class also defines a 'Run' method that indicates how to run tests in that class. The 'Run' method is responsible for actually performing the test and for reporting the results.
'Test' is an abstract class.
You can extend QMTest by providing your own test class implementation. If the test classes that come with QMTest cannot be used conveniently with your application domain, or if you would like to report more detailed information about passing and failing tests, you may wish to create a new test class.
To create your own test class, you must create a Python class derived (directly or indirectly) from 'Test'. The documentation for each method of 'Test' indicates whether you must override it in your test class implementation. Some methods may be overridden, but do not need to be. You might want to override such a method to provide a more efficient implementation, but QMTest will work fine if you just use the default version.
If QMTest calls a method on a test and that method raises an exception that is not caught within the method itself, QMTest will catch the exception and continue processing.
|
|||
OutcomeField An 'OutcomeField' contains an outcome. |
|||
TestField A 'TestField' contains the name of a test. |
|||
Inherited from Inherited from |
|
|||
|
|||
|
|||
Inherited from Inherited from Inherited from |
|
|||
arguments =
A list of the arguments to the extension class. |
|||
kind =
A string giving kind of extension is implemented by the class. |
|||
PREREQUISITES_FIELD_ID =
The name of the field that contains the prerequisites on which this test depends. |
|||
_argument_dictionary =
A map from argument names to 'Field' instances. |
|||
_argument_list =
A list of all the 'Field's in this class. |
|||
prerequisites =
|
|||
target_group =
|
|||
Inherited from Inherited from |
|
|||
Inherited from |
|
Run the test. 'context' -- A 'Context' giving run-time parameters to the test. 'result' -- A 'Result' object. The outcome will be 'Result.PASS' when this method is called. The 'result' may be modified by this method to indicate outcomes other than 'Result.PASS' or to add annotations. This method should not return a value. Derived classes must override this method. |
Returns the pattern for the targets that can run this test. returns -- A regular expression (represented as a string) that indicates the targets on which this test can be run. If the pattern matches a particular group name, the test can be run on targets in that group. |
|
argumentsA list of the arguments to the extension class. Each element of this list should be an instance of 'Field'. The 'Field' instance describes the argument. Derived classes may redefine this class variable. However, derived classes should not explicitly include the arguments from base classes; QMTest will automatically combine all the arguments found throughout the class hierarchy.
|
_argument_dictionaryA map from argument names to 'Field' instances. A map from the names of arguments for this class to the corresponding 'Field'.
|
_argument_listA list of all the 'Field's in this class. This list combines the complete list of 'arguments'. 'Field's appear in the order reached by a pre-order breadth-first traversal of the hierarchy, starting from the most derived class.
|
Home | Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 on Fri Dec 23 12:30:42 2011 | http://epydoc.sourceforge.net |