Gaudi Framework, version v24r2

Home   Generated: Wed Dec 4 2013
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Member Functions | Public Attributes | Private Member Functions | List of all members
GaudiTest.BasicOutputValidator Class Reference

Output Validation Classes. More...

Public Member Functions

def __init__
 
def __call__
 

Public Attributes

 reference
 
 cause
 
 result_key
 

Private Member Functions

def __CompareText
 

Detailed Description

Output Validation Classes.

Basic implementation of an option validator for Gaudi tests.
This implementation is based on the standard (LCG) validation functions
used in QMTest.

Definition at line 295 of file GaudiTest.py.

Constructor & Destructor Documentation

def GaudiTest.BasicOutputValidator.__init__ (   self,
  ref,
  cause,
  result_key 
)

Definition at line 300 of file GaudiTest.py.

301  def __init__(self,ref,cause,result_key):
302  self.reference = ref
303  self.cause = cause
304  self.result_key = result_key

Member Function Documentation

def GaudiTest.BasicOutputValidator.__call__ (   self,
  out,
  result 
)
Validate the output of the program.

'stdout' -- A string containing the data written to the standard output
stream.

'stderr' -- A string containing the data written to the standard error
stream.

'result' -- A 'Result' object. It may be used to annotate
the outcome according to the content of stderr.

returns -- A list of strings giving causes of failure.

Definition at line 305 of file GaudiTest.py.

306  def __call__(self, out, result):
307  """Validate the output of the program.
308 
309  'stdout' -- A string containing the data written to the standard output
310  stream.
311 
312  'stderr' -- A string containing the data written to the standard error
313  stream.
314 
315  'result' -- A 'Result' object. It may be used to annotate
316  the outcome according to the content of stderr.
317 
318  returns -- A list of strings giving causes of failure."""
319 
320  causes = []
321  # Check to see if theoutput matches.
322  if not self.__CompareText(out, self.reference):
323  causes.append(self.cause)
324  result[self.result_key] = result.Quote(self.reference)
325 
326  return causes
def GaudiTest.BasicOutputValidator.__CompareText (   self,
  s1,
  s2 
)
private
Compare 's1' and 's2', ignoring line endings.

's1' -- A string.

's2' -- A string.

returns -- True if 's1' and 's2' are the same, ignoring
differences in line endings.

Definition at line 327 of file GaudiTest.py.

328  def __CompareText(self, s1, s2):
329  """Compare 's1' and 's2', ignoring line endings.
330 
331  's1' -- A string.
332 
333  's2' -- A string.
334 
335  returns -- True if 's1' and 's2' are the same, ignoring
336  differences in line endings."""
337 
338  # The "splitlines" method works independently of the line ending
339  # convention in use.
340  return s1.splitlines() == s2.splitlines()

Member Data Documentation

GaudiTest.BasicOutputValidator.cause

Definition at line 302 of file GaudiTest.py.

GaudiTest.BasicOutputValidator.reference

Definition at line 301 of file GaudiTest.py.

GaudiTest.BasicOutputValidator.result_key

Definition at line 303 of file GaudiTest.py.


The documentation for this class was generated from the following file:
Generated at Wed Dec 4 2013 14:33:23 for Gaudi Framework, version v24r2 by Doxygen version 1.8.2 written by Dimitri van Heesch, © 1997-2004