GaudiTesting.BaseTest.BasicOutputValidator Class Reference

Public Member Functions

def __init__ (self, ref, cause, result_key)
 
def __call__ (self, out, result)
 
def __init__ (self, ref, cause, result_key)
 
def __call__ (self, out, result)
 

Public Attributes

 ref
 
 cause
 
 result_key
 

Private Member Functions

def __CompareText (self, s1, s2)
 
def __CompareText (self, s1, s2)
 

Detailed Description

Definition at line 587 of file BaseTest.py.

Constructor & Destructor Documentation

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

Definition at line 589 of file BaseTest.py.

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

Definition at line 589 of file BaseTest.py.

Member Function Documentation

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

594  def __call__(self,out,result):
595  """Validate the output of the program.
596  'stdout' -- A string containing the data written to the standard output
597  stream.
598  'stderr' -- A string containing the data written to the standard error
599  stream.
600  'result' -- A 'Result' object. It may be used to annotate
601  the outcome according to the content of stderr.
602  returns -- A list of strings giving causes of failure."""
603 
604  causes=[]
605  #Check the output
606  if not self.__CompareText(out,self.ref):
607  causes.append(self.cause)
608  result[self.result_key] =result.Quote(self.ref)
609 
610 
611 
612  return causes
613 
def GaudiTesting.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 594 of file BaseTest.py.

594  def __call__(self,out,result):
595  """Validate the output of the program.
596  'stdout' -- A string containing the data written to the standard output
597  stream.
598  'stderr' -- A string containing the data written to the standard error
599  stream.
600  'result' -- A 'Result' object. It may be used to annotate
601  the outcome according to the content of stderr.
602  returns -- A list of strings giving causes of failure."""
603 
604  causes=[]
605  #Check the output
606  if not self.__CompareText(out,self.ref):
607  causes.append(self.cause)
608  result[self.result_key] =result.Quote(self.ref)
609 
610 
611 
612  return causes
613 
def GaudiTesting.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 614 of file BaseTest.py.

614  def __CompareText(self, s1, s2):
615  """Compare 's1' and 's2', ignoring line endings.
616  's1' -- A string.
617  's2' -- A string.
618  returns -- True if 's1' and 's2' are the same, ignoring
619  differences in line endings."""
620  if ROOT6WorkAroundEnabled('ReadRootmapCheck'):
621  # FIXME: (MCl) Hide warnings from new rootmap sanity check until we can fix them
622  to_ignore = re.compile(r'Warning in <TInterpreter::ReadRootmapFile>: .* is already in .*')
623  keep_line = lambda l: not to_ignore.match(l)
624  return filter(keep_line, s1.splitlines()) == filter(keep_line, s2.splitlines())
625  else:
626  return s1.splitlines() == s2.splitlines()
627 
628 
629 
630 #------------------------ Preprocessor elements ------------------------#
def GaudiTesting.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 614 of file BaseTest.py.

614  def __CompareText(self, s1, s2):
615  """Compare 's1' and 's2', ignoring line endings.
616  's1' -- A string.
617  's2' -- A string.
618  returns -- True if 's1' and 's2' are the same, ignoring
619  differences in line endings."""
620  if ROOT6WorkAroundEnabled('ReadRootmapCheck'):
621  # FIXME: (MCl) Hide warnings from new rootmap sanity check until we can fix them
622  to_ignore = re.compile(r'Warning in <TInterpreter::ReadRootmapFile>: .* is already in .*')
623  keep_line = lambda l: not to_ignore.match(l)
624  return filter(keep_line, s1.splitlines()) == filter(keep_line, s2.splitlines())
625  else:
626  return s1.splitlines() == s2.splitlines()
627 
628 
629 
630 #------------------------ Preprocessor elements ------------------------#

Member Data Documentation

GaudiTesting.BaseTest.BasicOutputValidator.cause

Definition at line 591 of file BaseTest.py.

GaudiTesting.BaseTest.BasicOutputValidator.ref

Definition at line 590 of file BaseTest.py.

GaudiTesting.BaseTest.BasicOutputValidator.result_key

Definition at line 592 of file BaseTest.py.


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