seAppBase Class Reference

Base class for all script engine tests. More...

Inheritance diagram for seAppBase:

Inheritance graph
[legend]
Collaboration diagram for seAppBase:

Collaboration graph
[legend]
List of all members.

Public Member Functions

def __init__
 seAppBase constructor.
def getRunSequence
 Return the order of transitions for this type of application.
def doAbort
 Request an abort.
def doReset
 Reset the application.
def error
 This method is called when an undefined transition is requested.
def getSuiteState
def getAppState
def getActivitiesObject
def seSetup
 SETUP transition method.
def seTeardown
 TEARDOWN transition method.
def seStartRun
 START_RUN transition method.
def seRun
 RUN transition method.
def seStopRun
 STOP_RUN transition method.
def getCompletionStatusStr
 Return the description of the completion status.
def __endActivity
 finalize the activities database entry
def __genReport
 Generate the run report.
def startExcludeTime
 Save the start time for exclusion from the run's elapsed time.
def endExcludeTime
 Strobe the end time for exclusion from the run's elapsed time.
def adjustExcludeTime
 This method allows adjustment of the amount of time to be excluded from the run's elapsed time.
def __jacket
 Jacketting method for catching exceptions.
def __stopRun
 Logic executed during a stop run.
def __logEndRun
 Log the end of the run.
def __removeZeroLengthFile
 Delete the file if the file size is zero length.
def __exportData
 Export all relevant data from a run.
def __rcLastLine
 Get the last line of the run report file.
def __handleEndRunDlg
 Handle the end run dialog.

Private Attributes

 __completionStatus

Classes

class  StopRequestedException

Detailed Description

Base class for all script engine tests.

All script engine test applications should inherit from this base class. This class in turn inherits from the FSM (a finite state machine) class which allows the scriptRun method to go through its transitions and execute the test.

getRunSequence() method notifies the script engine as to the order of the transitions to be processed. If any of the transition methods return a value other than None, then the transition is rejected and the test is put back to the RESET state.

Definition at line 42 of file seAppBase.py.


Member Function Documentation

def __endActivity   self  ) 
 

finalize the activities database entry

Called from __genReport

Definition at line 455 of file seAppBase.py.

def __exportData   self  ) 
 

Export all relevant data from a run.

Routine to export all relevant data from a run to local storage and possibly to offsite backup. This routine is designed to execute after the completion of a run, but before teardown of Run Control. The name of the export directory is the run ID. This is to guarantee against unintentional overwrites between multiple teststands.

Definition at line 752 of file seAppBase.py.

def __genReport   self  ) 
 

Generate the run report.

Called through the GUI bridge

Definition at line 467 of file seAppBase.py.

def __handleEndRunDlg   self  ) 
 

Handle the end run dialog.

Definition at line 862 of file seAppBase.py.

def __init__   self,
  common
 

seAppBase constructor.

Parameters:
common ScriptEngineCommon instance. Contains session helper methods such as preferences, command line options, etc.

Reimplemented in dumpModules, testAppInput, testCVT, testMemDump, testReport, and testVscMinimal.

Definition at line 44 of file seAppBase.py.

def __jacket   self,
  function,
  args,
  kwargs
 

Jacketting method for catching exceptions.

This method is used for catching exceptions and initiating graceful termination of the user application.

Parameters:
function The function being jacketted
*args Unnamed arguments passed to function
**kwargs Named arguments passed to function

Definition at line 665 of file seAppBase.py.

def __logEndRun   self,
  fn
 

Log the end of the run.

Parameters:
fn The function name it is called from

Definition at line 719 of file seAppBase.py.

def __rcLastLine   self  ) 
 

Get the last line of the run report file.

Returns:
Last line of the run report.

Definition at line 830 of file seAppBase.py.

def __removeZeroLengthFile   self,
  filePath,
  fileName
 

Delete the file if the file size is zero length.

Parameters:
filePath 
fileName 
Returns:
0 If file size is not zero or if the deletion is successful. -1 If the deletion is not successful.

Definition at line 734 of file seAppBase.py.

def __stopRun   self  ) 
 

Logic executed during a stop run.

This method is responsible for:

  • Calculating the final elapsed time
  • Bringing up the end run dialog
  • Setting the completion status
  • Creating the test report

Definition at line 682 of file seAppBase.py.

def adjustExcludeTime   self,
  dExcludeTime
 

This method allows adjustment of the amount of time to be excluded from the run's elapsed time.

The amount of time to be excluded from the run's elapsed time can be adjusted positivily or negativily with this method. It does not take into account any other effects on the excluded time, such as whether the run was in the PAUSED state.

Parameters:
dExcludeTime The amount of time to be excluded as given by the difference of two time.time() values.

Definition at line 648 of file seAppBase.py.

def doAbort   self  ) 
 

Request an abort.

Definition at line 160 of file seAppBase.py.

def doReset   self  ) 
 

Reset the application.

Definition at line 167 of file seAppBase.py.

def endExcludeTime   self  ) 
 

Strobe the end time for exclusion from the run's elapsed time.

This method allows excluding some amount of time from the run's elapsed time. The end time is the time that the method is called. The difference between the end time and the start time is added to the excluded time.

Definition at line 626 of file seAppBase.py.

def error   self  ) 
 

This method is called when an undefined transition is requested.

Definition at line 180 of file seAppBase.py.

def getActivitiesObject   self  ) 
 

\brief Return the activities table interface

Definition at line 195 of file seAppBase.py.

def getAppState   self  ) 
 

Definition at line 192 of file seAppBase.py.

def getCompletionStatusStr   self  ) 
 

Return the description of the completion status.

Returns the code as set by the script or 'UNDEFINED' if it hasn't been set.

Returns:
Completion status description.

Definition at line 439 of file seAppBase.py.

def getRunSequence   self  ) 
 

Return the order of transitions for this type of application.

Returns:
A list of transitions

Definition at line 153 of file seAppBase.py.

def getSuiteState   self  ) 
 

Definition at line 187 of file seAppBase.py.

def seRun   self  ) 
 

RUN transition method.

Calls self.run()

Returns:
None for success or False if there is an exception or status returned by the user script.

Definition at line 384 of file seAppBase.py.

def seSetup   self  ) 
 

SETUP transition method.

Calls self.setup()

Returns:
None for success or False if there is an exception or status returned by the user script.

Definition at line 201 of file seAppBase.py.

def seStartRun   self  ) 
 

START_RUN transition method.

Calls self.startRun()

Returns:
None for success or False if there is an exception or status returned by the user script.

Definition at line 247 of file seAppBase.py.

def seStopRun   self  ) 
 

STOP_RUN transition method.

Calls self.stopRun()

Definition at line 406 of file seAppBase.py.

def seTeardown   self  ) 
 

TEARDOWN transition method.

Calls self.teardown()

Returns:
None for success or status returned by the user script.

Definition at line 224 of file seAppBase.py.

def startExcludeTime   self  ) 
 

Save the start time for exclusion from the run's elapsed time.

This method allows excluding some amount of time from the run's elapsed time. The start time is the time that the method is called.

Note that time spent in the PAUSED state is also excluded from the elapsed time value. Overlapping time is excluded from the elapsed time only once.

Definition at line 603 of file seAppBase.py.


Member Data Documentation

__completionStatus [private]
 

Definition at line 430 of file seAppBase.py.


The documentation for this class was generated from the following file:
Generated on Thu Apr 27 20:53:15 2006 for LICOS L02-01-00 by doxygen 1.4.6-NO