All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
BaseTest.BasicOutputValidator Class Reference

Public Member Functions

def __init__
 
def __call__
 

Public Attributes

 ref
 
 cause
 
 result_key
 

Private Member Functions

def __CompareText
 

Detailed Description

Definition at line 504 of file BaseTest.py.

Constructor & Destructor Documentation

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

Definition at line 506 of file BaseTest.py.

507  def __init__(self,ref,cause,result_key):
508  self.ref=ref
509  self.cause=cause
510  self.result_key=result_key

Member Function Documentation

def BaseTest.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 511 of file BaseTest.py.

512  def __call__(self,out,result):
513  """Validate the output of the program.
514  'stdout' -- A string containing the data written to the standard output
515  stream.
516  'stderr' -- A string containing the data written to the standard error
517  stream.
518  'result' -- A 'Result' object. It may be used to annotate
519  the outcome according to the content of stderr.
520  returns -- A list of strings giving causes of failure."""
521 
522  causes=[]
523  #Check the output
524  if not self.__CompareText(out,self.ref):
525  causes.append(self.cause)
526  result[self.result_key] =result.Quote(self.ref)
527 
528 
529 
530  return causes
def BaseTest.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 531 of file BaseTest.py.

532  def __CompareText(self, s1, s2):
533  """Compare 's1' and 's2', ignoring line endings.
534  's1' -- A string.
535  's2' -- A string.
536  returns -- True if 's1' and 's2' are the same, ignoring
537  differences in line endings."""
538  if ROOT6WorkAroundEnabled('ReadRootmapCheck'):
539  # FIXME: (MCl) Hide warnings from new rootmap sanity check until we can fix them
540  to_ignore = re.compile(r'Warning in <TInterpreter::ReadRootmapFile>: .* is already in .*')
541  keep_line = lambda l: not to_ignore.match(l)
542  return filter(keep_line, s1.splitlines()) == filter(keep_line, s2.splitlines())
543  else:
544  return s1.splitlines() == s2.splitlines()
545 
546 
547 
#------------------------ Preprocessor elements ------------------------#
def ROOT6WorkAroundEnabled
Definition: BaseTest.py:403

Member Data Documentation

BaseTest.BasicOutputValidator.cause

Definition at line 508 of file BaseTest.py.

BaseTest.BasicOutputValidator.ref

Definition at line 507 of file BaseTest.py.

BaseTest.BasicOutputValidator.result_key

Definition at line 509 of file BaseTest.py.


The documentation for this class was generated from the following file: