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

Constructor & Destructor Documentation

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

Definition at line 617 of file BaseTest.py.

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

Definition at line 617 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 622 of file BaseTest.py.

622  def __call__(self,out,result):
623  """Validate the output of the program.
624  'stdout' -- A string containing the data written to the standard output
625  stream.
626  'stderr' -- A string containing the data written to the standard error
627  stream.
628  'result' -- A 'Result' object. It may be used to annotate
629  the outcome according to the content of stderr.
630  returns -- A list of strings giving causes of failure."""
631 
632  causes=[]
633  #Check the output
634  if not self.__CompareText(out,self.ref):
635  causes.append(self.cause)
636  result[self.result_key] =result.Quote(self.ref)
637 
638 
639 
640  return causes
641 
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 622 of file BaseTest.py.

622  def __call__(self,out,result):
623  """Validate the output of the program.
624  'stdout' -- A string containing the data written to the standard output
625  stream.
626  'stderr' -- A string containing the data written to the standard error
627  stream.
628  'result' -- A 'Result' object. It may be used to annotate
629  the outcome according to the content of stderr.
630  returns -- A list of strings giving causes of failure."""
631 
632  causes=[]
633  #Check the output
634  if not self.__CompareText(out,self.ref):
635  causes.append(self.cause)
636  result[self.result_key] =result.Quote(self.ref)
637 
638 
639 
640  return causes
641 
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 642 of file BaseTest.py.

642  def __CompareText(self, s1, s2):
643  """Compare 's1' and 's2', ignoring line endings.
644  's1' -- A string.
645  's2' -- A string.
646  returns -- True if 's1' and 's2' are the same, ignoring
647  differences in line endings."""
648  if ROOT6WorkAroundEnabled('ReadRootmapCheck'):
649  # FIXME: (MCl) Hide warnings from new rootmap sanity check until we can fix them
650  to_ignore = re.compile(r'Warning in <TInterpreter::ReadRootmapFile>: .* is already in .*')
651  keep_line = lambda l: not to_ignore.match(l)
652  return filter(keep_line, s1.splitlines()) == filter(keep_line, s2.splitlines())
653  else:
654  return s1.splitlines() == s2.splitlines()
655 
656 
657 
658 #------------------------ 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 642 of file BaseTest.py.

642  def __CompareText(self, s1, s2):
643  """Compare 's1' and 's2', ignoring line endings.
644  's1' -- A string.
645  's2' -- A string.
646  returns -- True if 's1' and 's2' are the same, ignoring
647  differences in line endings."""
648  if ROOT6WorkAroundEnabled('ReadRootmapCheck'):
649  # FIXME: (MCl) Hide warnings from new rootmap sanity check until we can fix them
650  to_ignore = re.compile(r'Warning in <TInterpreter::ReadRootmapFile>: .* is already in .*')
651  keep_line = lambda l: not to_ignore.match(l)
652  return filter(keep_line, s1.splitlines()) == filter(keep_line, s2.splitlines())
653  else:
654  return s1.splitlines() == s2.splitlines()
655 
656 
657 
658 #------------------------ Preprocessor elements ------------------------#

Member Data Documentation

GaudiTesting.BaseTest.BasicOutputValidator.cause

Definition at line 619 of file BaseTest.py.

GaudiTesting.BaseTest.BasicOutputValidator.ref

Definition at line 618 of file BaseTest.py.

GaudiTesting.BaseTest.BasicOutputValidator.result_key

Definition at line 620 of file BaseTest.py.


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