Package qm :: Package test :: Package classes :: Module dejagnu_test :: Class DejaGNUTest
[hide private]
[frames] | no frames]

Class DejaGNUTest

source code

         object --+            
                  |            
extension.Extension --+        
                      |        
      runnable.Runnable --+    
                          |    
                  test.Test --+
                              |
   dejagnu_base.DejaGNUBase --+
                              |
                             DejaGNUTest

A 'DejaGNUTest' emulates a DejaGNU test.

See 'framework.exp' in the DejaGNU distribution for more information.

Nested Classes [hide private]
  BuildExecutable
A 'BuildExecutable' runs on the build machine.

Inherited from test.Test: OutcomeField, TestField

Inherited from runnable.Runnable: ResourceField

Inherited from extension.Extension: Type, __metaclass__

Instance Methods [hide private]
 
_GetTargetEnvironment(self, context)
Return additional environment variables to set on the target.
source code
 
_RunBuildExecutable(self, context, result, file, args=[], dir=None)
Run 'file' on the target.
source code
 
_RunTargetExecutable(self, context, result, file)
Run 'file' on the target.
source code
 
_RecordDejaGNUOutcome(self, result, outcome, message, expectation=None)
Record a DejaGNU outcome.
source code
 
_Unresolved(self, result, message)
Record an 'unresolved' DejaGNU outcome.
source code
 
_Error(self, message)
Raise an exception indicating an error in the test.
source code
 
_GetSourcePath(self)
Return the path to the primary source file.
source code
 
_GetBuild(self, context)
Return the GNU triplet corresponding to the build machine.
source code
 
_GetTarget(self, context)
Return the GNU triplet corresponding to the target machine.
source code
 
_IsNative(self, context)
Returns true if the build and target machines are the same.
source code
 
_SetUp(self, context)
Prepare to run a test.
source code
 
_ParseTclWords(self, s, variables={})
Separate 's' into words, in the same way that Tcl would.
source code

Inherited from test.Test: GetTargetGroup, Run

Inherited from runnable.Runnable: GetAttachments, GetDatabase, GetId, __init__

Inherited from extension.Extension: GetClassName, GetExplicitArguments, MakeDomDocument, MakeDomElement, Write, __getattr__

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Inherited from dejagnu_base.DejaGNUBase (private): _RecordCommand, _RecordCommandOutput

Class Variables [hide private]
  arguments = [qm.fields.AttachmentField(name= "source_file", ti...
A list of the arguments to the extension class.
  PASS = "PASS"
  FAIL = "FAIL"
  KFAIL = "KFAIL"
  KPASS = "KPASS"
  XPASS = "XPASS"
  XFAIL = "XFAIL"
  WARNING = "WARNING"
  ERROR = "ERROR"
  UNTESTED = "UNTESTED"
  UNRESOLVED = "UNRESOLVED"
  UNSUPPORTED = "UNSUPPORTED"
  dejagnu_outcomes = PASS, FAIL, XPASS, XFAIL, WARNING, ERROR, U...
The DejaGNU test outcomes.
  outcome_map = {PASS: Result.PASS, FAIL: Result.FAIL, KFAIL: Re...
A map from DejaGNU outcomes to QMTest outcomes.
  executable_timeout = 300
The number of seconds a program is permitted to run on the target.
  RESULT_PREFIX = "DejaGNUTest.result_"
The prefix for DejaGNU result annotations.

Inherited from test.Test: PREREQUISITES_FIELD_ID, kind

Inherited from runnable.Runnable: EXTRA_DATABASE, EXTRA_ID, RESOURCE_FIELD_ID, resources

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

_GetTargetEnvironment(self, context)

source code 

Return additional environment variables to set on the target.

'context' -- The 'Context' in which this test is running.

returns -- A map from strings (environment variable names) to strings (values for those variables). These new variables are added to the environment when a program executes on the target.

_RunBuildExecutable(self, context, result, file, args=[], dir=None)

source code 

Run 'file' on the target.

'context' -- The 'Context' in which this test is running.

'result' -- The 'Result' of this test.

'file' -- The path to the executable file.

'args' -- The arguments to the 'file'.

'dir' -- The directory in which the program should execute.

returns -- A pair '(status, output)'. The 'status' is the exit status from the command; the 'output' is the combined results of the standard output and standard error streams.

_RunTargetExecutable(self, context, result, file)

source code 

Run 'file' on the target.

'context' -- The 'Context' in which this test is running.

'result' -- The 'Result' of this test.

'file' -- The path to the executable file.

returns -- One of the 'dejagnu_outcomes'.

_RecordDejaGNUOutcome(self, result, outcome, message, expectation=None)

source code 

Record a DejaGNU outcome.

'result' -- A 'Result' object.

'outcome' -- One of the 'dejagnu_outcomes'.

'message' -- A string, explaining the outcome.

'expectation' -- If not 'None, the DejaGNU outcome that was expected.

_Unresolved(self, result, message)

source code 

Record an 'unresolved' DejaGNU outcome.

This function is identical to 'RecordDejaGNUOutcome', except that the 'outcome' is always 'UNRESOLVED'.

_Error(self, message)

source code 

Raise an exception indicating an error in the test.

'message' -- A description of the problem.

This function is used when the original Tcl code in DejaGNU would have used the Tcl 'error' primitive. These situations indicate problems with the test itself, such as incorrect usage of special test commands.

_GetSourcePath(self)

source code 

Return the path to the primary source file.

returns -- A string giving the path to the primary source file.

_GetBuild(self, context)

source code 

Return the GNU triplet corresponding to the build machine.

'context' -- The 'Context' in which the test is running.

returns -- The GNU triplet corresponding to the target machine, i.e,. the machine on which the compiler will run.

_GetTarget(self, context)

source code 

Return the GNU triplet corresponding to the target machine.

'context' -- The 'Context' in which the test is running.

returns -- The GNU triplet corresponding to the target machine, i.e,. the machine on which the programs generated by the compiler will run.

_IsNative(self, context)

source code 

Returns true if the build and target machines are the same.

'context' -- The 'Context' in which this test is running.

returns -- True if this test is runing "natively", i.e., if the build and target machines are the same.

_SetUp(self, context)

source code 

Prepare to run a test.

'context' -- The 'Context' in which this test will run.

This method may be overridden by derived classes, but they must call this version.

Overrides: dejagnu_base.DejaGNUBase._SetUp

_ParseTclWords(self, s, variables={})

source code 

Separate 's' into words, in the same way that Tcl would.

's' -- A string.

'variables' -- A map from variable names to values. If Tcl variable substitutions are encountered in 's', the corresponding value from 'variables' will be used.

returns -- A sequence of strings, each of which is a Tcl word.

Command substitution is not supported and results in an exceptions. Invalid inputs (like the string consisting of a single quote) also result in exceptions.

See 'Tcl and the Tk Toolkit', by John K. Ousterhout, copyright 1994 by Addison-Wesley Publishing Company, Inc. for details about the syntax of Tcl.


Class Variable Details [hide private]

arguments

A 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.

Value:
[qm.fields.AttachmentField(name= "source_file", title= "Source File", \
description= """The source file."""),]

dejagnu_outcomes

The DejaGNU test outcomes.

Value:
PASS, FAIL, XPASS, XFAIL, WARNING, ERROR, UNTESTED, UNRESOLVED, UNSUPP\
ORTED

outcome_map

A map from DejaGNU outcomes to QMTest outcomes.

Value:
{PASS: Result.PASS, FAIL: Result.FAIL, KFAIL: Result.FAIL, KPASS: Resu\
lt.PASS, XPASS: Result.PASS, XFAIL: Result.FAIL, WARNING: Result.PASS,\
 ERROR: Result.ERROR, UNTESTED: Result.UNTESTED, UNRESOLVED: Result.UN\
TESTED, UNSUPPORTED: Result.UNTESTED}

RESULT_PREFIX

The prefix for DejaGNU result annotations.

All results that would be generated by DejaGNU are inserted into the QMTest result as annotations beginning with this prefix. The prefix is followed by an 1-indexed integer; earlier results are inserted with lower numbers.

Value:
"DejaGNUTest.result_"