Table of Contents

Class: DejaGNUTest qm/test/classes/dejagnu_test.py

A DejaGNUTest emulates a DejaGNU test.

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

Base Classes   
Test
DejaGNUBase
Methods   
_Error
_GetBuild
_GetSourcePath
_GetTarget
_GetTargetEnvironment
_IsNative
_ParseTclWords
_RecordDejaGNUOutcome
_RunBuildExecutable
_RunTargetExecutable
_SetUp
_Unresolved
  _Error 
_Error ( self,  message )

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.

Exceptions   
DejaGNUError, message
  _GetBuild 
_GetBuild ( self,  context )

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.
  _GetSourcePath 
_GetSourcePath ( self )

Return the patch to the primary source file.

returns
A string giving the path to the primary source file.
  _GetTarget 
_GetTarget ( self,  context )

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.
  _GetTargetEnvironment 
_GetTargetEnvironment ( self,  context )

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.
  _IsNative 
_IsNative ( self,  context )

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.
  _ParseTclWords 
_ParseTclWords (
        self,
        s,
        variables={},
        )

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.

Exceptions   
QMException, "Invalid Tcl string."
QMException, "Tcl command substitution is unsupported."
QMException, "Unsupported Tcl escape."
  _RecordDejaGNUOutcome 
_RecordDejaGNUOutcome (
        self,
        result,
        outcome,
        message,
        expectation=None,
        )

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.
  _RunBuildExecutable 
_RunBuildExecutable (
        self,
        context,
        result,
        file,
        args=[],
        dir=None,
        )

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 
_RunTargetExecutable (
        self,
        context,
        result,
        file,
        dir=None,
        )

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.
dir
The directory in which the program should execute.
returns
One of the dejagnu_outcomes.
  _SetUp 
_SetUp ( self,  context )

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.

  _Unresolved 
_Unresolved (
        self,
        result,
        message,
        )

Record an unresolved DejaGNU outcome.

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


Table of Contents

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