| The Gaudi Framework v32r1 (f65d50dc)

Public Member Functions | Public Attributes | Private Member Functions | List of all members
GaudiTesting.BaseTest.BasicOutputValidator Class Reference

## Public Member Functions
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)

## Detailed Description

Definition at line 702 of file BaseTest.py.

## Constructor & Destructor Documentation

## ◆ __init__()

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

Definition at line 703 of file BaseTest.py.

703 def __init__(self, ref, cause, result_key):
704 self.ref = ref
705 self.cause = cause
706 self.result_key = result_key
707

## Member Function Documentation

## ◆ __call__()

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

708 def __call__(self, out, result):
709 """Validate the output of the program.
710 'stdout' -- A string containing the data written to the standard output
711 stream.
712 'stderr' -- A string containing the data written to the standard error
713 stream.
714 'result' -- A 'Result' object. It may be used to annotate
715 the outcome according to the content of stderr.
716 returns -- A list of strings giving causes of failure."""
717
718 causes = []
719 # Check the output
720 if not self.__CompareText(out, self.ref):
721 causes.append(self.cause)
722 result[self.result_key] = result.Quote(self.ref)
723
724 return causes
725

## ◆ __CompareText()

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

726 def __CompareText(self, s1, s2):
727 """Compare 's1' and 's2', ignoring line endings.
728 's1' -- A string.
729 's2' -- A string.
730 returns -- True if 's1' and 's2' are the same, ignoring
731 differences in line endings."""
732 if ROOT6WorkAroundEnabled('ReadRootmapCheck'):
733 # FIXME: (MCl) Hide warnings from new rootmap sanity check until we
734 # can fix them
735 to_ignore = re.compile(
736 r'Warning in <TInterpreter::ReadRootmapFile>: .* is already in .*'
737 )
738
739 def keep_line(l):
740 return not to_ignore.match(l)
741
742 return filter(keep_line, s1.splitlines()) == filter(
743 keep_line, s2.splitlines())
744 else:
745 return s1.splitlines() == s2.splitlines()
746
747
748 # ------------------------ Preprocessor elements ------------------------#
GaudiTesting.BaseTest.ROOT6WorkAroundEnabled
def ROOT6WorkAroundEnabled(id=None)
Definition: BaseTest.py:614

## Member Data Documentation

## ◆ cause

GaudiTesting.BaseTest.BasicOutputValidator.cause

Definition at line 705 of file BaseTest.py.

## ◆ ref

GaudiTesting.BaseTest.BasicOutputValidator.ref

Definition at line 704 of file BaseTest.py.

## ◆ result_key

GaudiTesting.BaseTest.BasicOutputValidator.result_key

Definition at line 706 of file BaseTest.py.

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

- GaudiPolicy/python/GaudiTesting/BaseTest.py