| The Gaudi Framework v29r1 (5cd95fa2)

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

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

## Constructor & Destructor Documentation

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

Definition at line 641 of file BaseTest.py.

641 def __init__(self, ref, cause, result_key):
642 self.ref = ref
643 self.cause = cause
644 self.result_key = result_key
645
GaudiTesting.BaseTest.BasicOutputValidator.ref
ref
Definition: BaseTest.py:642
GaudiTesting.BaseTest.BasicOutputValidator.cause
cause
Definition: BaseTest.py:643
GaudiTesting.BaseTest.BasicOutputValidator.result_key
result_key
Definition: BaseTest.py:644
GaudiTesting.BaseTest.BasicOutputValidator.__init__
def __init__(self, ref, cause, result_key)
Definition: BaseTest.py:641

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

646 def __call__(self, out, result):
647 """Validate the output of the program.
648 'stdout' -- A string containing the data written to the standard output
649 stream.
650 'stderr' -- A string containing the data written to the standard error
651 stream.
652 'result' -- A 'Result' object. It may be used to annotate
653 the outcome according to the content of stderr.
654 returns -- A list of strings giving causes of failure."""
655
656 causes = []
657 # Check the output
658 if not self.__CompareText(out, self.ref):
659 causes.append(self.cause)
660 result[self.result_key] = result.Quote(self.ref)
661
662 return causes
663
GaudiTesting.BaseTest.BasicOutputValidator.ref
ref
Definition: BaseTest.py:642
GaudiTesting.BaseTest.BasicOutputValidator.__call__
def __call__(self, out, result)
Definition: BaseTest.py:646
GaudiTesting.BaseTest.BasicOutputValidator.cause
cause
Definition: BaseTest.py:643
GaudiTesting.BaseTest.BasicOutputValidator.result_key
result_key
Definition: BaseTest.py:644
GaudiTesting.BaseTest.BasicOutputValidator.__CompareText
def __CompareText(self, s1, s2)
Definition: BaseTest.py:664

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

664 def __CompareText(self, s1, s2):
665 """Compare 's1' and 's2', ignoring line endings.
666 's1' -- A string.
667 's2' -- A string.
668 returns -- True if 's1' and 's2' are the same, ignoring
669 differences in line endings."""
670 if ROOT6WorkAroundEnabled('ReadRootmapCheck'):
671 # FIXME: (MCl) Hide warnings from new rootmap sanity check until we can fix them
672 to_ignore = re.compile(
673 r'Warning in <TInterpreter::ReadRootmapFile>: .* is already in .*')
674
675 def keep_line(l): return not to_ignore.match(l)
676 return filter(keep_line, s1.splitlines()) == filter(keep_line, s2.splitlines())
677 else:
678 return s1.splitlines() == s2.splitlines()
679
680
681 #------------------------ Preprocessor elements ------------------------#
GaudiTesting.BaseTest.BasicOutputValidator.__CompareText
def __CompareText(self, s1, s2)
Definition: BaseTest.py:664
GaudiTesting.BaseTest.ROOT6WorkAroundEnabled
def ROOT6WorkAroundEnabled(id=None)
Definition: BaseTest.py:553

## Member Data Documentation

GaudiTesting.BaseTest.BasicOutputValidator.cause

Definition at line 643 of file BaseTest.py.

GaudiTesting.BaseTest.BasicOutputValidator.ref

Definition at line 642 of file BaseTest.py.

GaudiTesting.BaseTest.BasicOutputValidator.result_key

Definition at line 644 of file BaseTest.py.

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

- GaudiPolicy/python/GaudiTesting/BaseTest.py