| The Gaudi Framework v29r0 (ff2e7097)

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

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

Public Member Functions | Public Attributes | List of all members
GaudiTest.ReferenceFileValidator Class Reference

## Public Member Functions
def | __init__ (self, reffile, cause, result_key, preproc=normalizeExamples)
def | __call__ (self, stdout, result)

## Public Attributes
| reffile
| cause
| result_key
| preproc

## Detailed Description

Definition at line 650 of file GaudiTest.py.

## Constructor & Destructor Documentation

def GaudiTest.ReferenceFileValidator.__init__ | ( |  | self,
|  |  | reffile,
|  |  | cause,
|  |  | result_key,
|  |  | preproc = `normalizeExamples`
| ) |  |

Definition at line 651 of file GaudiTest.py.

651 def __init__(self, reffile, cause, result_key, preproc=normalizeExamples):
652 self.reffile = os.path.expandvars(reffile)
653 self.cause = cause
654 self.result_key = result_key
655 self.preproc = preproc
656
GaudiTest.ReferenceFileValidator.__init__
def __init__(self, reffile, cause, result_key, preproc=normalizeExamples)
Definition: GaudiTest.py:651
GaudiTest.ReferenceFileValidator.result_key
result_key
Definition: GaudiTest.py:654
GaudiTest.ReferenceFileValidator.cause
cause
Definition: GaudiTest.py:653
GaudiTest.ReferenceFileValidator.preproc
preproc
Definition: GaudiTest.py:655
GaudiTest.ReferenceFileValidator.reffile
reffile
Definition: GaudiTest.py:652

## Member Function Documentation

def GaudiTest.ReferenceFileValidator.__call__ | ( |  | self,
|  |  | stdout,
|  |  | result
| ) |  |

Definition at line 657 of file GaudiTest.py.

657 def __call__(self, stdout, result):
658 causes = []
659 if os.path.isfile(self.reffile):
660 orig = open(self.reffile).xreadlines()
661 if self.preproc:
662 orig = self.preproc(orig)
663 else:
664 orig = []
665
666 new = stdout.splitlines()
667 if self.preproc:
668 new = self.preproc(new)
669 #open(self.reffile + ".test","w").writelines(new)
670 diffs = difflib.ndiff(orig, new, charjunk=difflib.IS_CHARACTER_JUNK)
671 filterdiffs = map(lambda x: x.strip(), filter(
672 lambda x: x[0] != " ", diffs))
673 #filterdiffs = [x.strip() for x in diffs]
674 if filterdiffs:
675 result[self.result_key] = result.Quote("\n".join(filterdiffs))
676 result[self.result_key] += result.Quote("""
677 Legend:
678 -) reference file
679 +) standard output of the test""")
680 causes.append(self.cause)
681
682 return causes
683
Containers::map
struct GAUDI_API map
Parametrisation class for map-like implementation.
Definition: KeyedObjectManager.h:26
GaudiTest.ReferenceFileValidator.__call__
def __call__(self, stdout, result)
Definition: GaudiTest.py:657
GaudiTest.ReferenceFileValidator.result_key
result_key
Definition: GaudiTest.py:654
GaudiTest.ReferenceFileValidator.cause
cause
Definition: GaudiTest.py:653
GaudiTest.ReferenceFileValidator.preproc
preproc
Definition: GaudiTest.py:655
GaudiTest.ReferenceFileValidator.reffile
reffile
Definition: GaudiTest.py:652

## Member Data Documentation

GaudiTest.ReferenceFileValidator.cause

Definition at line 653 of file GaudiTest.py.

GaudiTest.ReferenceFileValidator.preproc

Definition at line 655 of file GaudiTest.py.

GaudiTest.ReferenceFileValidator.reffile

Definition at line 652 of file GaudiTest.py.

GaudiTest.ReferenceFileValidator.result_key

Definition at line 654 of file GaudiTest.py.

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

- GaudiPolicy/qmtest_classes/GaudiTest.py