| The Gaudi Framework v28r2p1 (f1a77ff4)

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

## Constructor & Destructor Documentation

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

Definition at line 605 of file BaseTest.py.

605 def __init__(self,ref,cause,result_key):
606 self.ref=ref
607 self.cause=cause
608 self.result_key=result_key
609
GaudiTesting.BaseTest.BasicOutputValidator.ref
ref
Definition: BaseTest.py:606
GaudiTesting.BaseTest.BasicOutputValidator.cause
cause
Definition: BaseTest.py:607
GaudiTesting.BaseTest.BasicOutputValidator.result_key
result_key
Definition: BaseTest.py:608
GaudiTesting.BaseTest.BasicOutputValidator.__init__
def __init__(self, ref, cause, result_key)
Definition: BaseTest.py:605

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

610 def __call__(self,out,result):
611 """Validate the output of the program.
612 'stdout' -- A string containing the data written to the standard output
613 stream.
614 'stderr' -- A string containing the data written to the standard error
615 stream.
616 'result' -- A 'Result' object. It may be used to annotate
617 the outcome according to the content of stderr.
618 returns -- A list of strings giving causes of failure."""
619
620 causes=[]
621 #Check the output
622 if not self.__CompareText(out,self.ref):
623 causes.append(self.cause)
624 result[self.result_key] =result.Quote(self.ref)
625
626
627
628 return causes
629
GaudiTesting.BaseTest.BasicOutputValidator.ref
ref
Definition: BaseTest.py:606
GaudiTesting.BaseTest.BasicOutputValidator.__call__
def __call__(self, out, result)
Definition: BaseTest.py:610
GaudiTesting.BaseTest.BasicOutputValidator.cause
cause
Definition: BaseTest.py:607
GaudiTesting.BaseTest.BasicOutputValidator.result_key
result_key
Definition: BaseTest.py:608
GaudiTesting.BaseTest.BasicOutputValidator.__CompareText
def __CompareText(self, s1, s2)
Definition: BaseTest.py:630

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

630 def __CompareText(self, s1, s2):
631 """Compare 's1' and 's2', ignoring line endings.
632 's1' -- A string.
633 's2' -- A string.
634 returns -- True if 's1' and 's2' are the same, ignoring
635 differences in line endings."""
636 if ROOT6WorkAroundEnabled('ReadRootmapCheck'):
637 # FIXME: (MCl) Hide warnings from new rootmap sanity check until we can fix them
638 to_ignore = re.compile(r'Warning in <TInterpreter::ReadRootmapFile>: .* is already in .*')
639 keep_line = lambda l: not to_ignore.match(l)
640 return filter(keep_line, s1.splitlines()) == filter(keep_line, s2.splitlines())
641 else:
642 return s1.splitlines() == s2.splitlines()
643
644
645
646 #------------------------ Preprocessor elements ------------------------#
GaudiTesting.BaseTest.BasicOutputValidator.__CompareText
def __CompareText(self, s1, s2)
Definition: BaseTest.py:630
GaudiTesting.BaseTest.ROOT6WorkAroundEnabled
def ROOT6WorkAroundEnabled(id=None)
Definition: BaseTest.py:519

## Member Data Documentation

GaudiTesting.BaseTest.BasicOutputValidator.cause

Definition at line 607 of file BaseTest.py.

GaudiTesting.BaseTest.BasicOutputValidator.ref

Definition at line 606 of file BaseTest.py.

GaudiTesting.BaseTest.BasicOutputValidator.result_key

Definition at line 608 of file BaseTest.py.

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

- GaudiPolicy/python/GaudiTesting/BaseTest.py