Table of Contents

Class: QMTest qm/test/cmdline.py

An instance of QMTest.

Methods   
Execute
GetCommandOption
GetDatabase
GetExecutablePath
GetFileResultStreamClass
GetGlobalOption
GetTargetFileName
GetTargets
GetTargetsFromFile
GetTextResultStreamClass
GetTracer
HasCommandOption
HasGlobalOption
MakeContext
__CheckExtensionKind
__ExecuteCreate
__ExecuteCreateTarget
__ExecuteCreateTdb
__ExecuteExtensions
__ExecuteRegister
__ExecuteRemote
__ExecuteRun
__ExecuteServer
__ExecuteSummarize
__FilterTestsToRun
__GetAttributeOptions
__GetExpectedOutcomes
__GetResultStreams
__WriteCommandHelp
__init__
  Execute 
Execute ( self )

Execute the command.

returns
0 if the command was executed successfully. 1 if there was a problem or if any tests run had unexpected outcomes.
Exceptions   
qm.cmdline.CommandError, qm.error( "missing command" )
  GetCommandOption 
GetCommandOption (
        self,
        option,
        default=None,
        )

Return the value of command option.

option
The long form of an command-specific option.
default
The default value to be returned if the option was not specified. This option should be the kind of an option that takes an argument.
returns
The value specified by the option, or default if the option was not specified.
  GetDatabase 
GetDatabase ( self )

Return the test database to use.

  GetExecutablePath 
GetExecutablePath ( self )

Return the path to the QMTest executable.

returns
A string giving the path to the QMTest executable. This is the path that should be used to invoke QMTest recursively. Returns None if the path to the QMTest executable is uknown.
  GetFileResultStreamClass 
GetFileResultStreamClass ( self )

Return the ResultStream class used for results files.

returns
The ResultStream class used for results files.
  GetGlobalOption 
GetGlobalOption (
        self,
        option,
        default=None,
        )

Return the value of global option, or default if omitted.

  GetTargetFileName 
GetTargetFileName ( self )

Return the path to the file containing target specifications.

returns
The path to the file containing target specifications.
  GetTargets 
GetTargets ( self )

Return the Target objects specified by the user.

returns
A sequence of Target objects.
Exceptions   
qm.cmdline.CommandError, qm.error( "concurrency not integer", value = concurrency )
  GetTargetsFromFile 
GetTargetsFromFile ( self,  file_name )

Return the 'Target's specified in file_name.

returns
A list of the Target objects specified in the target specification file file_name.
Exceptions   
QMException, qm.error( "could not load target file", file = file_name )
  GetTextResultStreamClass 
GetTextResultStreamClass ( self )

Return the ResultStream class used for textual feedback.

returns
the ResultStream class used for textual feedback.
  GetTracer 
GetTracer ( self )

Return the Tracer associated with this instance of QMTest.

returns
The Tracer associated with this instance of QMTest.
  HasCommandOption 
HasCommandOption ( self,  option )

Return true if command option was specified.

  HasGlobalOption 
HasGlobalOption ( self,  option )

Return true if option was specified as a global command.

command
The long name of the option, but without the preceding "--".
returns
True if the option is present.
  MakeContext 
MakeContext ( self )

Construct a Context object for running tests.

Exceptions   
qm.cmdline.CommandError, msg
  __CheckExtensionKind 
__CheckExtensionKind ( self,  kind )

Check that kind is a valid extension kind.

kind
A string giving the name of an extension kind. If the kind does not name a valid extension kind, an appropriate exception is raised.
Exceptions   
qm.cmdline.CommandError, qm.error( "invalid extension kind", kind = kind )
  __ExecuteCreate 
__ExecuteCreate ( self )

Create a new extension file.

  __ExecuteCreateTarget 
__ExecuteCreateTarget ( self )

Create a new target file.

  __ExecuteCreateTdb 
__ExecuteCreateTdb ( self,  db_path )

Handle the command for creating a new test database.

db_path
The path at which to create the new test database.
  __ExecuteExtensions 
__ExecuteExtensions ( self )

List the available extension classes.

  __ExecuteRegister 
__ExecuteRegister ( self )

Register a new extension class.

Exceptions   
qm.QMException, qm.error( "module does not exist", module = module )
qm.cmdline.CommandError, qm.error( "invalid class name", class_name = class_name )
qm.cmdline.CommandError, qm.error( "invalid extension kind", kind = kind )
  __ExecuteRemote 
__ExecuteRemote ( self )

Execute the remote command.

  __ExecuteRun 
__ExecuteRun ( self )

Execute a run command.

Exceptions   
qm.cmdline.CommandError, qm.error( "seed not integer", seed = seed )
qm.cmdline.CommandError, qm.error("no such ID", id = str( exception ) )
qm.cmdline.CommandError, str( exception )
  __ExecuteServer 
__ExecuteServer ( self )

Process the server command.

Exceptions   
qm.cmdline.CommandError, qm.error( "bad port number" )
qm.cmdline.CommandError, str( e )
  __ExecuteSummarize 
__ExecuteSummarize ( self )

Read in test run results and summarize.

Exceptions   
QMException, qm.error("invalid results file", path = results_path, problem = str( exception ) )
qm.cmdline.CommandError, qm.error("no such ID", id = str( exception ) )
  __FilterTestsToRun 
__FilterTestsToRun ( self,  test_names )

Return those tests from test_names that should be run.

test_names
A sequence of test names.
returns
Those elements of test_names that are not to be skipped. If a precedes b in test_names, and both a and b are present in the result, a will precede b in the result.
  __GetAttributeOptions 
__GetAttributeOptions ( self )

Return the attributes specified on the command line.

returns
A dictionary mapping attribute names (strings) to values (strings). There is an entry for each attribute specified with --attribute on the command line.
  __GetExpectedOutcomes 
__GetExpectedOutcomes ( self )

Return the expected outcomes for this test run.

returns
A map from test names to outcomes corresponding to the expected outcome files provided on the command line. If no expected outcome files are provided, an empty map is returned.
Exceptions   
qm.cmdline.CommandError, str( e )
  __GetResultStreams 
__GetResultStreams ( self )

Return the result streams to use.

returns
A list of ResultStream objects, as indicated by the user.
Exceptions   
qm.cmdline.CommandError, qm.error( "invalid results format", format = format, valid_formats = valid_format_string )
  __WriteCommandHelp 
__WriteCommandHelp ( self,  command )

Write out help information about command.

command
The name of the command for which help information is required.
  __init__ 
__init__ (
        self,
        argument_list,
        path,
        )

Construct a new QMTest.

Parses the argument list but does not execute the command.

argument_list
The arguments to QMTest, not including the initial argv[0].
path
The path to the QMTest executable.

Table of Contents

This document was automatically generated on Mon Jan 3 09:42:29 2005 by HappyDoc version 2.1